- #!/usr/local/bin/python3
- #coding=UTF-8
- '''''
- Created on 2011-2-25
- @author: Jacky
- '''
- #继承
- class Base:
- def __init__(self,arg):
- print("base arg:",arg)
- class Child(Base):
- def __init__(self,arg):
- #旧版super()用法,现在不推荐使用
- #super(__class__,self).__init__(arg)
- #调用父类的初始化方法
- super().__init__(arg)
- print("child arg:",arg)
- c = Child(10)