[IronPython] Bug in handling of keyword arguments for __call__

Dino Viehland dinov at exchange.microsoft.com
Wed Feb 14 20:15:05 CET 2007


They're certainly very similar but I'm not entirely certain if they're the same (although they may be).  In the other bug type.__call__ is a type object which isn't right.  If we were picking up type.__call__ instead of F.__call__ then I'd expect a different exception (as type.__call__ is a type, and types are callable w/ kw-args).  I won't be certain until I look at it closer but I would expect that we're looking up the wrong thing when we do the call on f but I'm not sure where we'd be getting the wrong thing from.
The good news is both of these are fixed in some internal (post v1.1) builds but the bad news is those aren't on CodePlex yet.

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Andrew
Sent: Wednesday, February 14, 2007 10:54 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Bug in handling of keyword arguments for __call__

It seems that this refers to Item # 7594:
http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=7594
2007/2/14, Giles Thomas <giles.thomas at resolversystems.com <mailto:giles.thomas at resolversystems.com> >:
Many thanks, Dino.  This might be of use when debugging:

----
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 "F.__call__(%s, %s)" % (args, kwargs)
...
>>> print F.__call__
<class '__main__.F'>
>>>
----




Dino Viehland wrote:
> 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> [mailto: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<mailto: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<mailto:users at lists.ironpython.com>
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> _______________________________________________
> users mailing list
> users at lists.ironpython.com <mailto:users at lists.ironpython.com>
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>

--
Giles Thomas
giles.thomas at resolversystems.com<mailto: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<mailto:users at lists.ironpython.com>
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20070214/fc834ba2/attachment.html>


More information about the Ironpython-users mailing list