Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r82805:08867b5b10b9
Date: 2016-03-06 00:52 +0100
http://bitbucket.org/pypy/pypy/changeset/08867b5b10b9/

Log:    Back out 395abeb42996, add test that shows why

diff --git a/pypy/interpreter/function.py b/pypy/interpreter/function.py
--- a/pypy/interpreter/function.py
+++ b/pypy/interpreter/function.py
@@ -432,7 +432,8 @@
     # this is not defined as a method on Function because it's generally
     # useful logic: w_function can be any callable.  It is used by Method too.
     asking_for_bound = (space.is_none(w_cls) or
-                        not space.is_w(w_obj, space.w_None))
+                        not space.is_w(w_obj, space.w_None) or
+                        space.is_w(w_cls, space.type(space.w_None)))
     if asking_for_bound:
         return space.wrap(Method(space, w_function, w_obj, w_cls))
     else:
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
@@ -258,8 +258,13 @@
         assert meth() == obj
 
     def test_none_get_interaction(self):
+        skip("XXX issue #2083")
         assert type(None).__repr__(None) == 'None'
 
+    def test_none_get_interaction_2(self):
+        f = None.__repr__
+        assert f() == 'None'
+
     def test_no_get_builtin(self):
         assert not hasattr(dir, '__get__')
         class A(object):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to