Message412520
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 positional argument: 'a'" which leaves out that the keyword only argument is also required.
Another solution would be something like:
TypeError: foo() missing 3 required arguments: 'a' (positional only), 'b', 'c' (keyword only)
This solution scales to the worst complex cases, and is a lot clearer imo. Could even be further improved with some nicer formatting:
TypeError: foo() missing 3 required arguments:
'a' (positional only)
'b'
'c' (keyword only)
But that might be a bit overkill :) |
|
Date |
User |
Action |
Args |
2022-02-04 17:13:07 | Anders.Hovmöller | set | recipients:
+ Anders.Hovmöller, eric.smith |
2022-02-04 17:13:07 | Anders.Hovmöller | set | messageid: <1643994787.57.0.527137368603.issue46637@roundup.psfhosted.org> |
2022-02-04 17:13:07 | Anders.Hovmöller | link | issue46637 messages |
2022-02-04 17:13:07 | Anders.Hovmöller | create | |
|