On Wed, Jun 28, 2000 at 02:12:28PM -0700, Guido van Rossum wrote: >... > - chunk #2: > The id() function guarantees a unique return value for different > objects. It does this by returning the pointer to the object. By > returning a PyInt, on Win64 (sizeof(long) < sizeof(void*)) the pointer > is truncated and the guarantee may be proven false. The appropriate > return function is PyLong_FromVoidPtr, this returns a PyLong if that > is necessary to return the pointer without truncation. > > [GvR: note that this means that id() can now return a long on Win32 > platforms. This *might* break some code...] Strictly speaking: the Long only occurs on Win64 platforms. I would guess that it is also possible on say, an Alpha running Linux. Presuming that has 64-bit pointers(?). Regardless: yes, it can certainly break some code. IMO, if any code out there makes any kinds of assumptions about id(), then they deserve to be broken :-) Cheers, -g -- Greg Stein, http://www.lyra.org/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4