> If %x will return a negative hex number, then the internals of id() > must make sure that they return a positive number, or whatever does > the standard repr will need to change as well. I'll log a bug on SF > for it. The standard repr is written in C and uses %p, which does a platform specific thing, but typically produces an unsigned hex number of appropriate length; apparently we've not been ported to platforms where it does something else, otherwise the test would have failed there too. One can argue that the test is too constrained anyway -- why should we care about the specific hex number in the repr() of a class? I'm not for adding %p to Python's string formats; it's too implementation specific and I don't see a use for it other than matching the built-in repr(). id() has always returned negative numbers on all platforms where pointers happen to have the high bit set; apart from making this test pass in the future (which is a pretty weak argument) I don't see a problem with that, so I'm not in favor of changing it, even though it would be easy enough to change PyLong_FromVoidPtr() to call PyLong_FromLong[Long](). --Guido van Rossum (home page: http://www.python.org/~guido/)
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