python-super函数
来源:互联网 发布:java初学者书籍推荐 编辑:程序博客网 时间:2024/06/05 09:22
super函数主要为了调用超类的方法
__metaclass__=typeclass Bird(): def __init__(self): self.hungry=True def eat(self): if self.hungry: print 'Ahah' self.hungry=False else: print 'No,thanks'class SongBird(Bird): def __init__(self): super(Bird,self).__init__() self.sound='Squark' def sing(self): print self.sound
—>a=SongBird()
—>a.sing()
Squawk!
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的build-in函数super()
- python继承关系之super函数
- Python进阶(七):super()函数
- 【Python基础】Python面向对象 - 5 - super()函数
- python--super
- python super
- python: super
- LeetCode-34.Search for a Range
- vertica-优化编码
- 浅谈SPI总线
- 使用jquery可见性过滤选择器
- HTML5调用手机摄像头拍照
- python-super函数
- jquery属性过滤选择器
- 1002. 写出这个数 (20)
- [INS-40406] 未检测到现有的 Oracle Grid Infrastructure 软件
- iOS中模拟器常用操作
- HTML5 Canvas+JS控制电脑或手机上的摄像头实例
- 设计模式笔记-Adapter模式
- 99-Ugly Number II
- TensorFlow0.8源码阅读 -- 代码目录结构讲解