[pypy-issue] Issue #2306: PyPy3 stricter handling of __new__/__init__ arguments (pypy/pypy)
issues-reply at bitbucket.org
Sun May 22 19:18:56 EDT 2016
New issue 2306: PyPy3 stricter handling of __new__/__init__ arguments
Python 3 makes `object.__new/init__` stricter (raise TypeErrors) about accepting any arguments depending on whether or not these methods were overwritten.
This is currently annoying to implement on PyPy because we don't perfectly match CPython's use of `__new/init__` methods (e.g. PyPy's type doesn't implement an `__init__`) and that causes the rules to go haywire:
CPython 2.x issues warnings in these cases (PyPy doesn't). That newinitwarn branch linked above is an attempt to see how many warnings would be issued on 2.7 -- by making them errors. It's currently very broken, due to lack of `type.__init__`, but likely needs more work after that one's fixed.
Maybe we can emulate CPython by special casing not <type>.is_heaptype -- we should probably just fix our mismatch `__new/init__`s though
Py3k's test for this is:
More information about the pypy-issue