class A(object): def __init__(self): self.qq = 1 class B(A): def test(self): print self.qq