python old-style inherit invoke parent member way
2012-11-19 14:35
316 查看
#!/usr/bin/env python
#encoding=utf-8
class A():
def __init__(self):
self.a="bb"
print "A"
class B(A):
def __init__(self):
A.__init__(self)
print self.a
print "B"
B()
#encoding=utf-8
class A():
def __init__(self):
self.a="bb"
print "A"
class B(A):
def __init__(self):
A.__init__(self)
print self.a
print "B"
B()
相关文章推荐
- Qt child widget stop inherit parent widget image(Qt子窗体stylesheet不继承父窗体stylesheet)
- Python 内建函数 - compile(source, filename, mode, flags=0, dont_inherit=False, optimize=-1)
- I do not want to inherit the child opacity from the parent in CSS(不想让子元素继承父元素的透明度)
- Advice From An Old Programmer(Learn Python The Hard Way, 2nd Edition)
- Python标准库:内置函数compile(source, filename, mode, flags=0, dont_inherit=False, optimize=-1)
- Pythonn new-style class and old-style class
- Python标准库:内置函数compile(source, filename, mode, flags=0, dont_inherit=False, optimize=-1)
- The best way to deal with large files in Python style
- [IT学习]Learn Python the Hard Way (Using Python 3)笨办法学Python3版本
- Illegal use of <when>-style tag without <choose> as its direct parent
- export variable if the child shell wanted to inherit the environment variables of parent shell
- style="direction:inherit"的作用
- python invoke super parent method
- 去掉Actionbar左侧的图标<style name="MyActionBar" parent="@android:style/Widget.Holo.ActionBar"> <it
- IT界各大语言角逐风云,JAVA PHP Python竟被它完虐?
- 关于问题The fully qualified name of the bean's class, except if it serves only as a parent definition fo
- Oracle Http Server安装mod_python,运行报错fatal: Not a git repository (or any of the parent directories)
- CSS中height:100%和height:inherit的异同
- 用python itchat写一个微信机器人自动回复
- python--getitme\setitem 支持索引与分片