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 Anders.Hovmöller
Recipients Anders.Hovmöller, eric.smith
Date 2022-02-04.17:13:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1643994787.57.0.527137368603.issue46637@roundup.psfhosted.org>
In-reply-to
Content
For `foo(a, /, b)`, it could be:

"TypeError: foo() missing 1 required argument 'a', and one required positional argument 'b'.

If we start on this road there are some more, like for `def foo(a, *, b)` you get the error "TypeError: foo() missing 1 required positional argument: 'a'" which leaves out that the keyword only argument is also required. 

Another solution would be something like:

TypeError: foo() missing 3 required arguments: 'a' (positional only), 'b', 'c' (keyword only)

This solution scales to the worst complex cases, and is a lot clearer imo. Could even be further improved with some nicer formatting:

TypeError: foo() missing 3 required arguments: 
    'a' (positional only)
    'b'
    'c' (keyword only)

But that might be a bit overkill :)
History
Date User Action Args
2022-02-04 17:13:07Anders.Hovmöllersetrecipients: + Anders.Hovmöller, eric.smith
2022-02-04 17:13:07Anders.Hovmöllersetmessageid: <1643994787.57.0.527137368603.issue46637@roundup.psfhosted.org>
2022-02-04 17:13:07Anders.Hovmöllerlinkissue46637 messages
2022-02-04 17:13:07Anders.Hovmöllercreate