Terry J. Reedy <tjre...@udel.edu> added the comment:

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.

----------
nosy: +serhiy.storchaka, terry.reedy
versions: +Python 3.9 -Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue22652>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to