[IronPython] Metaclass bug?

Dino Viehland dinov at exchange.microsoft.com
Wed Mar 7 19:46:44 CET 2007


We're actively working on it now and you should see something in Alpha form by the summer at the very latest.

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sylvain Hellegouarch
Sent: Wednesday, March 07, 2007 9:13 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Metaclass bug?

Dino Viehland wrote:
> Thanks for reporting this Sylvain.  I believe this is the same or very similar to bug #7594 (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=7594).
>
> The good news is that this is fixed in our internal v2.0 branch.  The bad news is the fix was close to re-writing the type system (also fixing type(type) is type).  That makes it fairly unlikely that we'll be able to back port this to v1.x without seriously destabilizing it.  But it will be fixed in the future.
>

I like that good news but less the bad one :p
I can live with it for now. You would not have a rough idea as to when
you plan v2.0 for roughly?

- Sylvain

> -----Original Message-----
> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sylvain Hellegouarch
> Sent: Wednesday, March 07, 2007 6:15 AM
> To: Discussion of IronPython
> Subject: [IronPython] Metaclass bug?
>
> The following code:
>
> class C(object):
>     pass
>
> class Meta(type):
>     pass
>
> class A(object):
>     __metaclass__ = Meta
>
>     def __init__(self, e, s):
>         print "__init__ A"
>
>     def __call__(self, e, s):
>         print "__call__ A"
>
> class B(object):
>     def mount(self, c):
>         a = A(c, "")
>
> if __name__ == '__main__':
>     b = B()
>     b.mount(C())
>
>
> =============================================
> Python 2.5
> $ python test.py
> __init__ A
>
> =============================================
> IronPython 1.1b1 (1.1) on .NET 2.0.50727.42
> $ mono bin/ipy.exe test.py
> Traceback (most recent call last):
>   File test, line unknown, in Initialize
>   File test, line unknown, in mount
> TypeError: unbound method __call__() must be called with A instance as
> first argument (got C instance instead)
>
>
> It appears that because of the meta-class IP gets confused as to what to
> call since the __init__ and __call__ gave the same signature.
>
> - Sylvain
>
> _______________________________________________
> 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

_______________________________________________
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