"inherited" keyword in Python?

Alex Martelli aleaxit at yahoo.com
Tue Dec 5 16:19:46 EST 2000

Hi Niki,

> #class C(A,B):
> #...
> class C_help(A,B):
>   pass
> class C(C_help):
>   def foo( self ):
>     C_help.foo( self )
> I would like to have same functionality without writing X_help class
> whenever i need it.

I posted a solution based on just this idea 1 minute ago!-)

The complete version, which should work but I haven't tested:

import new
def super(klass):
    try: return klass._cached_super
        return klass.__dict__.getdefault(
            klass.__bases__, {})


Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.

More information about the Python-list mailing list