Author: Matti Picus <[email protected]>
Branch: issue2806_tp_init
Changeset: r94420:de6e457c5576
Date: 2018-04-23 01:01 +0300
http://bitbucket.org/pypy/pypy/changeset/de6e457c5576/
Log: issue 2806 - object.__init__ is called not CALL.__init__
diff --git a/pypy/module/cpyext/test/test_typeobject.py
b/pypy/module/cpyext/test/test_typeobject.py
--- a/pypy/module/cpyext/test/test_typeobject.py
+++ b/pypy/module/cpyext/test/test_typeobject.py
@@ -833,6 +833,14 @@
x = LL.__new__(LL)
assert module.tp_init(list, x, ("hi",)) is None
assert x == ["h", "i"]
+ init_called = []
+ class CALL(object):
+ def __init__(self):
+ init_called.append(42)
+ x = object.__new__(CALL)
+ x.__init__()
+ module.tp_init(CALL, x, ())
+ assert len(init_called) == 2
def test_mp_subscript(self):
module = self.import_extension('foo', [
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit