[IronPython] (trivial) bug in binding varargs
Ronnie Maor
ronnie.maor at gmail.com
Fri Nov 16 17:04:08 CET 2007
I know "fix trivial bugs week" is over, but still...
python 2.5:
>>> def log(*a,**kw):
print 'a=%s, kw=%s' % (a,kw)
>>> def foo(*a,**kw):
log(a=a,kw=kw)
>>> foo(1,2,x=3)
a=(), kw={'a': (1, 2), 'kw': {'x': 3}}
ironpython 1.1:
>>> def log(*a,**kw):
... print 'a=%s, kw=%s' % (a,kw)
...
>>> def foo(*a,**kw):
... log(a=a,kw=kw)
...
>>> foo(1,2,x=3)
Traceback (most recent call last):
File , line 0, in <stdin>##18
File , line 0, in foo
File , line 0, in foo
TypeError: log() got an unexpected keyword argument 'a'
workaround I used was changing "foo" to:
log(args=a,kwargs=kw)
More information about the Ironpython-users
mailing list