[IronPython] Error message for duplicate keyword arguments

Dino Viehland dinov at microsoft.com
Tue Sep 8 09:27:07 PDT 2009


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.


> -----Original Message-----
> From: users-bounces at lists.ironpython.com [mailto:users-
> bounces at lists.ironpython.com] 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
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


More information about the Users mailing list