[pypy-commit] pypy release-2.0.x: Like CPython, avoid returning negative numbers in "id()". We might
arigo
noreply at buildbot.pypy.org
Wed May 15 10:46:24 CEST 2013
Author: Armin Rigo <arigo at tunes.org>
Branch: release-2.0.x
Changeset: r64119:128e78d6a11a
Date: 2013-05-15 10:29 +0200
http://bitbucket.org/pypy/pypy/changeset/128e78d6a11a/
Log: Like CPython, avoid returning negative numbers in "id()". We might
still return negative numbers for id() of
ints/longs/floats/complexes but I'm not sure we care too much about
that.
diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -666,7 +666,8 @@
def id(self, w_obj):
w_result = w_obj.immutable_unique_id(self)
if w_result is None:
- w_result = self.wrap(compute_unique_id(w_obj))
+ # in the common case, returns an unsigned value
+ w_result = self.wrap(r_uint(compute_unique_id(w_obj)))
return w_result
def hash_w(self, w_obj):
More information about the pypy-commit
mailing list