PyPy incorrectly calls `__get__` on the result of looking up `__get__`
Here's an example:
class MagicCaller():
def __get__(*args):
print("MagicCaller.__get__")
return lambda *a1: lambda *a: (a1, a, args)
def __call__(*args):
print("MagicCaller.__call__")
return lambda *a: (a, args)
class Descriptor():
__get__ = MagicCaller()
class X():
__getattribute__ = Descriptor()
print(X().foo)
CPython prints:
MagicCaller.__call__
(('foo',), (<__main__.MagicCaller object at 0x7f11c8054e20>, <__main__.Descriptor object at 0x7f11c8054cd0>, <__main__.X object at 0x7f11c800b310>, <class '__main__.X'>))
PyPy prints
MagicCaller.__get__
((<__main__.X object at 0x00007fb299568410>, <class '__main__.X'>), ('foo',), (<__main__.MagicCaller object at 0x00007fb299568448>, <__main__.Descriptor object at 0x00007fb299568480>, <class '__main__.Descriptor'>))