[IronPython] (trivial) bug in binding varargs

Dino Viehland dinov at exchange.microsoft.com
Fri Nov 16 18:07:36 CET 2007


Luckily this is already fixed in 2.0 (method dispatch, in particular kw-arg dispatch, is completely different now).

We're discussing v1.x servicing plans next week so I'm going to hold off on opening a bug but will follow up after that.

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ronnie Maor
Sent: Friday, November 16, 2007 8:04 AM
To: users at lists.ironpython.com
Subject: [IronPython] (trivial) bug in binding varargs

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)
_______________________________________________
Users mailing list
Users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list