grandparent method with super

Martin Manns mmanns at gmx.de
Fri Apr 6 00:38:19 CEST 2007


On 5 Apr 2007 15:05:25 -0700
attn.steven.kuo at gmail.com wrote:
> 
> class E(C,D):
>     def m(self):
>         for cls in E.__mro__:
>             if cls != E and cls not in E.__bases__:
>                 cls.m(self)
>                 break
> 
> 
> ... but it's probably better that you
> rethink your class hierarchy.

After seeing the implications and the solutions, I will.

Thank you everyone for your help

Martin



More information about the Python-list mailing list