[issue34362] User-created types with wrong __new__ can be instantiated

ppperry report at bugs.python.org
Thu Aug 9 13:52:28 EDT 2018


ppperry <mapreader at olum.org> added the comment:

issue5322, despite its confusing title, mentions this exact bug in one of the comments below. 

It looks like there is one bug in the logic for assigning `__new__`, which causes `__new__` and `tp_new` to point to different things, confusing the error-handling logic in `object.__new__` as well as causing creation of a type by calling it to work in cases where direct calls to __new__ fail.

There's no one bug report about that, however issue5322, issue25731 and some cases of issue34284 are all symptoms of the same root issue.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34362>
_______________________________________


More information about the Python-bugs-list mailing list