python super
来源:互联网 发布:linux 挂载sd卡 编辑:程序博客网 时间:2024/05/01 02:02
子类继承多个父类时,需要一个个调用父类__init__方法,为了简便可以用super,它会按照顺序每个父类都调用过来,而且不会重复调用父类相同的部分
格式如:
class child(Parent): def __init__(self, name): super(child, self).__init__(name, 'str')它会将child的self转化为父类
参考:
http://www.cnblogs.com/dkblog/archive/2011/02/24/1980654.html
0 0
- python--super
- python super
- python: super
- python super()
- python super()
- python super
- python super()
- python super()
- python super()
- python - super
- Python Super
- python super()
- python super()
- python super()
- python super
- python super()
- python super()
- python super()
- 计算机网络-IP数据报格式
- 【VPN】-初识VPN
- wifi基础
- 蓝桥杯练习题Java实现 入门训练 Fibonacci数列
- c++的泛型编程与模板
- python super
- 第27篇 webrtc-IOS之运行测试用例及代码部署到设备
- 基于pix硬件的apm开发环境搭建
- Linux环境变量详解
- 2016年国内开源镜像站点汇总
- SpringMVC-InitBinder验证-对表单数据验证
- BroadCastReceiver
- Android必学-异步加载+Android自定义View源码【申明:来源于网络】
- Service