Nick Coghlan <ncogh...@gmail.com> added the comment:
The revised behaviour now makes the error messages consistent with each other: >>> class TooManyArgs(): ... def __new__(cls): ... super().__new__(cls, 1) ... >>> TooManyArgs() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 3, in __new__ TypeError: object.__new__() takes exactly one argument (the type to instantiate) >>> class NotEnoughArgs(): ... def __new__(cls): ... super().__new__() ... >>> NotEnoughArgs() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 3, in __new__ TypeError: object.__new__(): not enough arguments >>> class TooManyInitArgs(): ... def __init__(self): ... super().__init__(1, 2, 3) ... >>> TooManyInitArgs() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 3, in __init__ TypeError: object.__init__() takes exactly one argument (the instance to initialize) >>> class NotEnoughInitArgs(): ... def __init__(self): ... object.__init__() ... >>> NotEnoughInitArgs() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 3, in __init__ TypeError: descriptor '__init__' of 'object' object needs an argument ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31506> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com