summaryrefslogtreecommitdiff
path: root/pypers/super/example1.py
blob: 2265c788e0a93c0fb4c15967cf0f00c6c4c3f4fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# example1.py

class M(type):
    "A metaclass with a class attribute 'a'."
    a = 1 

class B:
    "An instance of M with a meta-attribute 'a'."
    __metaclass__ = M

class C(B):
    "An instance of M with the same meta-attribute 'a'"

if __name__ == "__main__":
    print B.a, C.a # => 1 1 
    print super(C,C).a #=> attribute error