Using object.__init__ as __init__ in a class acts differently as at CPython
When migrating code from CPython to PyPy3 found a bug when defining __init__
in a class as object.__init__
causes __init__
to act like it accepts only self
instead of self, *args, **kwargs
. This is not the case at Cpython.
Reproduction
Python 3.6.9 (7.3.1+dfsg-4, Apr 22 2020, 05:15:29)
[PyPy 7.3.1 with GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>> class test:
.... def __new__(cls, value):
.... return object.__new__(cls)
.... __init__ = object.__init__
....
>>>> test(1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: object.__init__() takes no parameters