Author: Manuel Jacob <[email protected]>
Branch: py3k
Changeset: r82834:12207b28f69e
Date: 2016-03-07 02:47 +0100
http://bitbucket.org/pypy/pypy/changeset/12207b28f69e/
Log: Adapt method identity changes to py3k.
diff --git a/pypy/interpreter/function.py b/pypy/interpreter/function.py
--- a/pypy/interpreter/function.py
+++ b/pypy/interpreter/function.py
@@ -539,8 +539,7 @@
if not isinstance(other, Method):
return False
return (self.w_instance is other.w_instance and
- self.w_function is other.w_function and
- self.w_class is other.w_class)
+ self.w_function is other.w_function)
def immutable_unique_id(self, space):
from pypy.objspace.std.util import IDTAG_METHOD as tag
@@ -551,7 +550,6 @@
else:
id = rbigint.fromint(0)
id = id.or_(space.bigint_w(space.id(self.w_function)))
- id = id.lshift(LONG_BIT).or_(space.bigint_w(space.id(self.w_class)))
id = id.lshift(IDTAG_SHIFT).int_or_(tag)
return space.newlong_from_rbigint(id)
diff --git a/pypy/interpreter/test/test_function.py
b/pypy/interpreter/test/test_function.py
--- a/pypy/interpreter/test/test_function.py
+++ b/pypy/interpreter/test/test_function.py
@@ -563,8 +563,8 @@
assert id(A.m) == id(A.m)
assert A.m is not A.n
assert id(A.m) != id(A.n)
- assert A.m is not B.m
- assert id(A.m) != id(B.m)
+ assert A.m is B.m
+ assert id(A.m) == id(B.m)
class TestMethod:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit