[issue34284] Nonsensical exception message when calling `__new__` on non-instaniable objects

ppperry report at bugs.python.org
Mon Jul 30 20:17:16 EDT 2018


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

The error I'm expecting here is "cannot create sys.flags objects". Anything else violates the fact that type(*args) is sugar for:

result = type.__new__(type, *args)
if isinstance(result, type):
    result.__init__(*args)

("type" in the above snippet is a variable name, not the actual builtin "type")

----------
title: Nonsensical exception message when calling `__new__` on some sys objects -> Nonsensical exception message when calling `__new__` on non-instaniable objects

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


More information about the Python-bugs-list mailing list