This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Misleading reported number of given arguments on function call TypeError
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: Alexander.Belopolsky, ezio.melotti, gsakkis
Priority: normal Keywords:

Created on 2010-03-19 01:57 by gsakkis, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg101298 - (view) Author: George Sakkis (gsakkis) Date: 2010-03-19 01:57
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.
msg101299 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2010-03-19 02:41
Duplicate of #6474.
History
Date User Action Args
2022-04-11 14:56:58adminsetgithub: 52421
2010-03-19 05:09:30Alexander.Belopolskysetnosy: + Alexander.Belopolsky
2010-03-19 02:42:52ezio.melottiunlinkissue6474 superseder
2010-03-19 02:41:59ezio.melottilinkissue6474 superseder
2010-03-19 02:41:09ezio.melottisetstatus: open -> closed
priority: normal


nosy: + ezio.melotti
messages: + msg101299
resolution: duplicate
stage: resolved
2010-03-19 01:57:34gsakkiscreate