[issue22652] Add suggestion about keyword arguments to this error message: "builtins.TypeError: my_func() takes 1 positional argument but 2 were given"

2020-05-15 Thread A. Jesse Jiryu Davis
A. Jesse Jiryu Davis added the comment: If the patch requires a rewrite and its value is uncertain then I'll excuse myself from this issue. -- ___ Python tracker ___

[issue22652] Add suggestion about keyword arguments to this error message: "builtins.TypeError: my_func() takes 1 positional argument but 2 were given"

2020-05-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: First, the code for checking arguments was significantly changed in recent versions. So if we are going to make these changes the patch should be not just rebased, but rewritten from zero. Second, the error messages for wrong number of positional

[issue22652] Add suggestion about keyword arguments to this error message: "builtins.TypeError: my_func() takes 1 positional argument but 2 were given"

2020-05-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: Also, python-ideas list is a good place to get more opinions (too many sometimes) on an enhancement proposal. -- ___ Python tracker ___

[issue22652] Add suggestion about keyword arguments to this error message: "builtins.TypeError: my_func() takes 1 positional argument but 2 were given"

2020-05-14 Thread Terry J. Reedy
Terry J. Reedy 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

[issue22652] Add suggestion about keyword arguments to this error message: builtins.TypeError: my_func() takes 1 positional argument but 2 were given

2015-04-13 Thread A. Jesse Jiryu Davis
A. Jesse Jiryu Davis added the comment: Attached patch adds and N keyword-only argument(s) to the TypeError message if a function takes keyword-only arguments and the wrong number of positional arguments is provided. -- keywords: +patch nosy: +emptysquare Added file:

[issue22652] Add suggestion about keyword arguments to this error message: builtins.TypeError: my_func() takes 1 positional argument but 2 were given

2015-04-12 Thread Ram Rachum
Ram Rachum added the comment: ztane: I don't think so. You're taking attention away from the and keyword-only arguments, where in fact this is the piece of information that's likely to save the user the most time, so therefore it should get more attention. --

[issue22652] Add suggestion about keyword arguments to this error message: builtins.TypeError: my_func() takes 1 positional argument but 2 were given

2015-04-12 Thread R. David Murray
R. David Murray added the comment: These messages are generated generically, and just because the proble you hit was this one, doesn't someone else won't hit it for a different reason and have other requirements. (Note that these messages are *way* better than they used to be, thanks to

[issue22652] Add suggestion about keyword arguments to this error message: builtins.TypeError: my_func() takes 1 positional argument but 2 were given

2015-04-11 Thread Antti Haapala
Antti Haapala added the comment: Would it be enough to just have the message say takes 1 positional argument and keyword-only arguments but 2 positional arguments were given? And this should of course for **kwargs too. -- nosy: +ztane ___ Python

[issue22652] Add suggestion about keyword arguments to this error message: builtins.TypeError: my_func() takes 1 positional argument but 2 were given

2014-11-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: - needs patch type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22652 ___

[issue22652] Add suggestion about keyword arguments to this error message: builtins.TypeError: my_func() takes 1 positional argument but 2 were given

2014-10-16 Thread Ram Rachum
New submission from Ram Rachum: When programming, I just got this exception: builtins.TypeError: my_func() takes 1 positional argument but 2 were given After a couple of minutes of investigation I figured out that the problem is that the function has a `*` in its signature, so arguments

[issue22652] Add suggestion about keyword arguments to this error message: builtins.TypeError: my_func() takes 1 positional argument but 2 were given

2014-10-16 Thread Ram Rachum
Ram Rachum added the comment: (I should note that I see this suggestion as low-priority, because it's very specific, so I'll completely understand if it's deemed to not be worth the added complexity.) -- ___ Python tracker rep...@bugs.python.org

[issue22652] Add suggestion about keyword arguments to this error message: builtins.TypeError: my_func() takes 1 positional argument but 2 were given

2014-10-16 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- priority: normal - low ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22652 ___ ___