summaryrefslogtreecommitdiff
path: root/pypers/super/ex.py
blob: 089dea961d7678c8a9f3dbdd5f576960d9da9610 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# ex.py

class B(object):
    def __repr__(self):
        return '<instance of %s>' % self.__class__.__name__
    def meth(self):
        print "B.meth(%s)" % self
    meth = classmethod(meth)

class C(B):
    def meth(self):
        print "C.meth(%s)" % self
        self.__super.meth()
    meth = classmethod(meth)

C._C__super = super(C)

class D(C):
    pass

D._D__super = super(D)


d=D()

d.meth()