self-inheritance...

Alex Martelli aleax at aleax.it
Thu Sep 6 06:38:49 EDT 2001


"Roman Suzi" <rnd at onego.ru> wrote in message
news:mailman.999720984.24088.python-list at python.org...
> Interestingly enough, it works as expected:
>
> >>> class Dolly:
> ...    def a(s): pass
> ...
> >>> class Dolly(Dolly):
> ...    def b(s): pass
> ...
> >>> a = Dolly()
> >>> a.
> a.__class__(  a.__doc__     a.__module__  a.a(          a.b(
>
> Are there any means first Dolly-class could use to
> intervene into inheritance mechanism and spoil
> it?

Maybe the first Dolly could inherit from a metaclass that might interfere
with further inheritance, or something like that.  I can't think of anything
that doesn't involve metaclasses.


Alex






More information about the Python-list mailing list