super(obj)?

Gustavo Niemeyer niemeyer at conectiva.com
Mon Feb 18 12:40:49 EST 2002


> It would usually be wrong. Consider
[...]
> This could does the expected: Derived2.doit call2 Derived1.doit calls
> Base.doit. If you change Derived1 to
[...]
> then self.__class__ would be Derived2, so the Derived1 would call
> itself recursively, instead of performing a super call.

Sure... you're 100% right. I forgot about the cascade effects. To make
this work, some way to know the local class would be necessary, and
this is probably not worth.

Thanks.

-- 
Gustavo Niemeyer

[ 2AAC 7928 0FBF 0299 5EB5  60E2 2253 B29A 6664 3A0C ]




More information about the Python-list mailing list