[New-bugs-announce] [issue8174] Misleading reported number of given arguments on function call TypeError

George Sakkis report at bugs.python.org
Fri Mar 19 02:57:36 CET 2010


New submission from George Sakkis <george.sakkis at gmail.com>:

The following exception message seems misleading, or at least not obvious:

>>> def f(a,b,c): pass
... 
>>> f(c=0,a=0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: f() takes exactly 3 non-keyword arguments (1 given)

Why "1 given" ? One could argue for either 0 or 2 given arguments but I fail to see how 1 is a reasonable answer.

----------
components: Interpreter Core
messages: 101298
nosy: gsakkis
severity: normal
status: open
title: Misleading reported number of given arguments on function call TypeError
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8174>
_______________________________________


More information about the New-bugs-announce mailing list