[IronPython] Bug in handling of keyword arguments for __call__

Dino Viehland dinov at exchange.microsoft.com
Wed Feb 14 18:07:54 CET 2007


Thanks for the bug report.  I've opened bug #8246 to track this (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=8246).

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Giles Thomas
Sent: Wednesday, February 14, 2007 7:17 AM
To: Discussion of IronPython
Subject: [IronPython] Bug in handling of keyword arguments for __call__

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

_______________________________________________
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