Dino Viehland wrote:
Filed as 24576
(http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=24576)
I don't know that it'll get fixed for 2.6 (although I will take a look). But
I think keyword arg calling needs some general work post-2.6 so that
polymorphic and megamorphic cases work faster and this fix could at least be
done at the same time as that.
It's a nuisance for the Python Tutorial, which gives an example of what
happens when you call a function incorrectly and the error message from
IronPython is both different and confusing. :-)
Michael
-----Original Message-----
From: [email protected] [mailto:users-
[email protected]] On Behalf Of Michael Foord
Sent: Monday, September 07, 2009 9:11 AM
To: Discussion of IronPython
Subject: [IronPython] Error message for duplicate keyword arguments
Hello all,
A confusing error message from IronPython 2.6 B2:
>>> def f(a=None):
... pass
...
>>> f(1, a=3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: f() takes at most 1 non-keyword argument (1 given)
CPython:
>>> def f(a=None):
... pass
...
>>> f(100, a='fish')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: f() got multiple values for keyword argument 'a'
>>>
--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com