Message368878
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. |
|
Date |
User |
Action |
Args |
2020-05-14 23:29:00 | terry.reedy | set | recipients:
+ terry.reedy, r.david.murray, cool-RR, serhiy.storchaka, ztane, emptysquare |
2020-05-14 23:29:00 | terry.reedy | set | messageid: <1589498940.11.0.851569335403.issue22652@roundup.psfhosted.org> |
2020-05-14 23:29:00 | terry.reedy | link | issue22652 messages |
2020-05-14 23:28:59 | terry.reedy | create | |
|