[issue46637] Incorrect error message: "missing 1 required positional argument"

2022-02-04 Thread Alex Waygood
Change by Alex Waygood : -- nosy: +AlexWaygood ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46637] Incorrect error message: "missing 1 required positional argument"

2022-02-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: I think the incorrect qualification should be dropped, if sanely feasible. More misleading are hidden positional-only args. Doc: min(iterable, *[, key, default]) min(arg1, arg2, *args[, key]) >>> min(iterator=(1,3)) Traceback (most recent call last):

[issue46637] Incorrect error message: "missing 1 required positional argument"

2022-02-04 Thread Andre Roberge
Change by Andre Roberge : -- nosy: +aroberge ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46637] Incorrect error message: "missing 1 required positional argument"

2022-02-04 Thread Anders Hovmöller
Anders Hovmöller added the comment: 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

[issue46637] Incorrect error message: "missing 1 required positional argument"

2022-02-04 Thread Eric V. Smith
Eric V. Smith added the comment: Given this current behavior: >>> def foo(a, /, b): pass ... >>> foo() Traceback (most recent call last): File "", line 1, in TypeError: foo() missing 2 required positional arguments: 'a' and 'b' What would you suggest? I agree the current messages aren't

[issue46637] Incorrect error message: "missing 1 required positional argument"

2022-02-04 Thread Anders Hovmöller
Anders Hovmöller added the comment: Just dropping the word "positional" is very good. That word is a lie, and just removing it makes it true. -- ___ Python tracker ___

[issue46637] Incorrect error message: "missing 1 required positional argument"

2022-02-04 Thread Eric V. Smith
Eric V. Smith added the comment: I guess the technically correct term is positional-or-keyword, but that seems like too much: https://docs.python.org/3/glossary.html I think dropping "positional" doesn't increase the precision of the error message, but I'll admit I can't think of anything

[issue46637] Incorrect error message: "missing 1 required positional argument"

2022-02-04 Thread Anders Hovmöller
New submission from Anders Hovmöller : >>> def foo(a): ... pass ... >>> foo() Traceback (most recent call last): File "", line 1, in TypeError: foo() missing 1 required positional argument: 'a' This error is incorrect. It says "positional argument", but it's just "argument". The proof