[pypy-svn] r7238 - pypy/trunk/src/pypy/tool
bob at codespeak.net
bob at codespeak.net
Mon Nov 15 15:31:47 CET 2004
Author: bob
Date: Mon Nov 15 15:31:46 2004
New Revision: 7238
Modified:
pypy/trunk/src/pypy/tool/uid.py
Log:
clean up implementation
Modified: pypy/trunk/src/pypy/tool/uid.py
==============================================================================
--- pypy/trunk/src/pypy/tool/uid.py (original)
+++ pypy/trunk/src/pypy/tool/uid.py Mon Nov 15 15:31:46 2004
@@ -1,7 +1,12 @@
import sys
+HUGEINT = (sys.maxint + 1L) * 2L
def uid(obj):
+ """
+ Return the id of an object as an unsigned number so that its hex
+ representation makes sense
+ """
rval = id(obj)
if rval < 0:
- rval += (long(sys.maxint)+1)*2
+ rval += HUGEINT
return rval
More information about the Pypy-commit
mailing list