[issue31506] Improve the error message logic for object_new & object_init
Nick Coghlan
report at bugs.python.org
Tue Feb 19 07:53:41 EST 2019
Nick Coghlan <ncoghlan at gmail.com> added the comment:
Paolo: it still won't be completely clear, since there's still the subtle issue that __new__ is a static method rather than a class method, so the correct calls up to the base class are respectively:
super(Singleton, cls).__new__(cls) # Static method, cls needs to be passed explicitly
super(Singleton, self).__init__() # Bound method, self filled in automatically
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31506>
_______________________________________
More information about the Python-bugs-list
mailing list