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

ppperry report at bugs.python.org
Sun Sep 2 11:17:31 EDT 2018


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

Also happens for some objects in the `_tkinter` module:
>>> _tkinter.TkttType.__new__(_tkinter.TkttType)
Traceback (most recent call last):
  File "<pyshell#126>", line 1, in <module>
    _tkinter.TkttType.__new__(_tkinter.TkttType)
TypeError: object.__new__(_tkinter.tktimertoken) is not safe, use _tkinter.tktimertoken.__new__()
>>> _tkinter.Tcl_Obj.__new__(_tkinter.Tcl_Obj)
Traceback (most recent call last):
  File "<pyshell#127>", line 1, in <module>
    _tkinter.Tcl_Obj.__new__(_tkinter.Tcl_Obj)
TypeError: object.__new__(_tkinter.Tcl_Obj) is not safe, use _tkinter.Tcl_Obj.__new__()
>>> _tkinter.TkappType.__new__(_tkinter.TkappType)
Traceback (most recent call last):
  File "<pyshell#128>", line 1, in <module>
    _tkinter.TkappType.__new__(_tkinter.TkappType)
TypeError: object.__new__(_tkinter.tkapp) is not safe, use _tkinter.tkapp.__new__()

----------

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


More information about the Python-bugs-list mailing list