t147.py 321 B

1234567891011121314151617
  1. class A:
  2. def __init__(self):
  3. print "at0"
  4. self.a = 'O'
  5. self.b = 'x'
  6. def test(self):
  7. print "KO"
  8. class B(A):
  9. def __init__(self):
  10. print "at1"
  11. A.__init__(self)
  12. self.b = 'K'
  13. def test(self):
  14. print self.a + self.b
  15. print "at2"
  16. B().test()
  17. print "at3"