using super

iu2 israelu at elbit.co.il
Tue Jan 1 05:00:23 EST 2008


On Jan 1, 9:59 am, Michele Simionato <michele.simion... at gmail.com>
wrote:

> No PEP, this would never pass. There would be no way
> to stop a method from calling its parent: you would
> lose control of your classes, so I think this is a
> bad idea.

Not all classes, only classes the programmer chooses to have this
behaviour.

>Having said so, it is easy to implement
> what you want with a metaclass:
>
> def callParent(*methodnames):
>      class Meta(type):
>          def __init__(cls, name, bases, dic):
...
Thanks



More information about the Python-list mailing list