Log in or register to vote.

Improved autosuper

Use self.super(*p, **kw) instead of super(cls, self).func(*p, **kw)

Automatically determine the correct super object and use it.

This module defines a mix-in class `autosuper` which has a single property -
`super`.

The object returned by `super` can either be called or have attributes accessed.
If it is called, a base class method with the same name as the current method
will be called with the parameters passed. If an attribute is accessed a base
class attribute will be returned.

Example of usage::

import autosuper

class A (autosuper.autosuper):

def __init__ (self, a, b):
self.super()
print 'A.__init__'
print a, b

def test (self, a, b):
print 'A.test ...

0