This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients CuriousLearner, miss-islington, ncoghlan, ppt000, serhiy.storchaka, xtreak
Date 2019-02-19.13:48:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550584114.18.0.88389234135.issue31506@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2019-02-19 13:48:34ncoghlansetrecipients: + ncoghlan, serhiy.storchaka, CuriousLearner, miss-islington, xtreak, ppt000
2019-02-19 13:48:34ncoghlansetmessageid: <1550584114.18.0.88389234135.issue31506@roundup.psfhosted.org>
2019-02-19 13:48:34ncoghlanlinkissue31506 messages
2019-02-19 13:48:34ncoghlancreate