This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2010年08月15日 17:33 by pitrou, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (7) | |||
|---|---|---|---|
| msg113976 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年08月15日 17:33 | |
None of these warnings look critical (one affects the "search finger" optimization of pop(), one affects the result from __length_hint__ on set iterators, and the other the hash value of frozensets without any obviously bad consequences), but you might want to take a look at them anyway. (for the record, a C "long" is 32-bit under 64-bit Windows, so a Py_ssize_t won't fit in it) 1>..\Objects\setobject.c(743) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'long', possible loss of data 1>..\Objects\setobject.c(772) : warning C4244: '*=' : conversion from 'Py_ssize_t' to 'long', possible loss of data 1>..\Objects\setobject.c(819) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'long', possible loss of data |
|||
| msg113984 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2010年08月15日 18:11 | |
For the length hint, it would be best to use PyLong_FromSize_t, as in dictobject.c. It would be sad if __length_hint__ would return a much-too-small value (or even a negative number). For the search finger, dictobject has opted to make me_hash of type Py_ssize_t. |
|||
| msg113996 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2010年08月15日 18:55 | |
Antoine, thanks for posting these. |
|||
| msg114001 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年08月15日 19:24 | |
There is also a similar warning for deque iterators' __length_hint__ (line 1124 in _collectionsmodule.c). |
|||
| msg114151 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年08月17日 19:40 | |
This is now fixed in r84146 (py3k) and r84151 (3.1). I've made the "hash" field a Py_ssize_t, consistently with the dict implementation. |
|||
| msg114152 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2010年08月17日 19:46 | |
I'm not sure whether backporting it to 3.1 is a good idea. It's potentially an ABI change (although a minor one, as the field offsets remain the same, only the interpretation of the padding may change). |
|||
| msg114155 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年08月17日 20:01 | |
> I'm not sure whether backporting it to 3.1 is a good idea. It's > potentially an ABI change (although a minor one, as the field offsets > remain the same, only the interpretation of the padding may change). Well, it is unlikely that anyone is accessing setentry structures directly, given that no API function returns one, and the hash collision resolution algorithm is not provided. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:05 | admin | set | github: 53821 |
| 2010年08月17日 20:01:08 | pitrou | set | messages: + msg114155 |
| 2010年08月17日 19:46:36 | loewis | set | messages: + msg114152 |
| 2010年08月17日 19:40:50 | pitrou | set | status: open -> closed resolution: fixed messages: + msg114151 |
| 2010年08月15日 19:24:50 | pitrou | set | messages: + msg114001 |
| 2010年08月15日 18:55:26 | rhettinger | set | messages: + msg113996 |
| 2010年08月15日 18:11:07 | loewis | set | nosy:
+ loewis messages: + msg113984 |
| 2010年08月15日 17:33:35 | pitrou | create | |