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 terry.reedy
Recipients cool-RR, emptysquare, r.david.murray, serhiy.storchaka, terry.reedy, ztane
Date 2020-05-14.23:28:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1589498940.11.0.851569335403.issue22652@roundup.psfhosted.org>
In-reply-to
Content
Serhiy, I am nosying you because you have worked on argument issues in the last year.

Minimal example: def f(a, *, b): pass.  In 3.9.0a6,

>>> f(1,2) # ... Same as 5 years ago.
  TypeError: f() takes 1 positional argument but 2 were given

My first inclination was that this is sufficient information.  But ...

>>> f(1,2,b=3) # ...
  TypeError: f() takes 1 positional argument but 2 positional arguments (and 1 keyword-only argument) were given

The simple message is equally sufficiant here, but more is given, and it seems strange to not then give the equivalent for for 'takes'.  So the patch to add more seems plausible (but I am not one to carefully review C code).

Jesse, if you still want your patch, possibly updated, considered, please make a PR.

We now also have positional-only arguments, and I am not sure how that affects my view on this issue.
History
Date User Action Args
2020-05-14 23:29:00terry.reedysetrecipients: + terry.reedy, r.david.murray, cool-RR, serhiy.storchaka, ztane, emptysquare
2020-05-14 23:29:00terry.reedysetmessageid: <1589498940.11.0.851569335403.issue22652@roundup.psfhosted.org>
2020-05-14 23:29:00terry.reedylinkissue22652 messages
2020-05-14 23:28:59terry.reedycreate