[Ironpython-users] super() with classmethod - deviation from CPython 2.7 behaviour

Michael van der Kolff mvanderkolff at gmail.com
Tue Jan 15 05:59:38 CET 2013


http://ironpython.codeplex.com/workitem/33663

Cheers,

Michael

On Tue, Jan 15, 2013 at 3:04 PM, Slide <slide.o.mix at gmail.com> wrote:
> Can you file an issue on codeplex please?
>
>
> On Mon, Jan 14, 2013 at 8:30 PM, Michael van der Kolff
> <mvanderkolff at gmail.com> wrote:
>>
>> Using the following script:
>> class A(object):
>>     @classmethod
>>     def x(cls):
>>         print cls.__name__
>>
>> class B(A):
>>     @classmethod
>>     def x(cls):
>>         super(B,cls).x()
>>
>> class C(B):
>>     pass
>>
>> class D(B):
>>     @classmethod
>>     def x(cls):
>>         super(D,cls).x()
>>
>> if __name__ == "__main__":
>>     B.x()
>>     C.x()
>>     D.x()
>>
>> using CPython 2.7.3 (win32 build), I get the following:
>> B
>> C
>> D
>>
>> Under IronPython 2.7.3 (64 & 32 bit builds), I get the following:
>> B
>> B
>> B
>>
>> This also occurs for other class properties, e.g. __doc__ or other
>> classmethods - i.e. super() is improperly changing which class object
>> is passed in.
>>
>> Cheers,
>>
>>
>> Michael
>> _______________________________________________
>> Ironpython-users mailing list
>> Ironpython-users at python.org
>> http://mail.python.org/mailman/listinfo/ironpython-users
>
>
>
>
> --
> Website: http://earl-of-code.com


More information about the Ironpython-users mailing list