[New-bugs-announce] [issue9326] Error message for incorrect number of (function) args is incorrect

Dave Fugate report at bugs.python.org
Wed Jul 21 22:44:07 CEST 2010


New submission from Dave Fugate <dfugate at microsoft.com>:

The error message below should state something along the lines of "f() takes at least 1 non-keyword argument (0 given)".  Regardless, this is a regression from 2.6 which would have emitted "f() takes at least 1 argument (0 given)" which while not perfect, is a more accurate description of the problem:


D:\rft\vsl\dlr\Languages\IronPython\Tests>27
Python 2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> def f(a, b=2): pass
...
>>> f(b=2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: f() takes at least 1 argument (1 given)
>>>

----------
messages: 111116
nosy: midnightdf
priority: normal
severity: normal
status: open
title: Error message for incorrect number of (function) args is incorrect
type: behavior
versions: Python 2.7

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


More information about the New-bugs-announce mailing list