grandparent method with super

Martin Manns mmanns at gmx.de
Thu Apr 5 18:38:19 EDT 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