[IronPython] Bug in handling of keyword arguments for __call__

Giles Thomas giles.thomas at resolversystems.com
Wed Feb 14 07:16:57 PST 2007


Hi,

It looks like there's a problem with calling a callable object using the 
"**" dictionary-unpacking syntax for keyword arguments.  Here's a 
minimal repro.

In CPython:

------------------------
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> class F(object):
...     def __call__(self, *args, **kwargs):
...         print args, kwargs
...
 >>> f = F()
 >>> f(*(1,), **{'a' : 23})
(1,) {'a': 23}
 >>>
------------------------

In IP 1.0.1 (also checked against 1.1 alpha):

---------------------
IronPython 1.0 (1.0.61005.1977) on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
 >>> class F(object):
...     def __call__(self, *args, **kwargs):
...         print args, kwargs
...
 >>> f = F()
 >>> f(*(1,), **{'a' : 23})
Traceback (most recent call last):
  File , line 0, in <stdin>##23
Exception: this object is not callable with keyword parameters
---------------------


Regards,

Giles

-- 
Giles Thomas
giles.thomas at resolversystems.com
+44 (0) 20 7253 6372

Resolver Systems Ltd
17a Clerkenwell Road, London EC1M 5RD, UK
VAT No.: GB 893 5643 79 
Registered in England and Wales as company number 5467329.
Registered address: 843 Finchley Road, London NW11 8NA, UK



More information about the users mailing list