Author CuriousLearner
Recipients CuriousLearner, ncoghlan, serhiy.storchaka
Date 2017-12-05.19:40:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1512502841.48.0.213398074469.issue31506@psf.upfronthosting.co.za>
In-reply-to
Content
Nick,

I think the error messages are incorrect. We expect error message to be `takes no argument` rather than `takes exactly one argument`. Can you please confirm that?

I think for the class without any method overrides, the functionality should be something like this:

     >>> class C:
    ...     pass
    ...
    >>> C(42)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: C() takes no arguments
    >>> C.__new__(C, 42)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: C() takes no arguments
    >>> C().__init__(42)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: C().__init__() takes no arguments
    >>> object.__new__(C, 42)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: C() takes no arguments
    >>> object.__init__(C(), 42)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: C().__init__() takes no arguments



Is that correct?
History
Date User Action Args
2017-12-05 19:40:41CuriousLearnersetrecipients: + CuriousLearner, ncoghlan, serhiy.storchaka
2017-12-05 19:40:41CuriousLearnersetmessageid: <1512502841.48.0.213398074469.issue31506@psf.upfronthosting.co.za>
2017-12-05 19:40:41CuriousLearnerlinkissue31506 messages
2017-12-05 19:40:41CuriousLearnercreate