[IronPython] Bug in handling of keyword arguments for __call__

Andrew szport at gmail.com
Wed Feb 14 10:53:34 PST 2007


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>:
>
> 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] 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
> > _______________________________________________
> > users mailing list
> > users at lists.ironpython.com
> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> >
>
> --
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20070214/e2cb47c4/attachment.htm 


More information about the users mailing list