Issue 15201: C argument errors and Python arguments error are different (original) (raw)
C argument errors and Python arguments error are different. For example: all(4,4,4) Traceback (most recent call last): File "", line 1, in TypeError: all() takes exactly one argument (3 given) def func(a):pass a(4,4) Traceback (most recent call last): File "", line 1, in TypeError: func() takes exactly 1 positional argument (2 given) I do not know which error message is better. I think the second example's (func) error message is better. Though feel free to vote by commenting on this bug. Another example with not enough arguments given: hasattr(4) Traceback (most recent call last): File "", line 1, in TypeError: hasattr expected 2 arguments, got 1 func() Traceback (most recent call last): File "", line 1, in TypeError: func() takes exactly 1 argument (0 given) I don't know which of this error messages are better. You can vote on this by commenting.