python
2016-07-27 22:31
344 查看
class Grandpa: def __init__(self): print "I Grandpa" class Father(Grandpa): def __init__(self): print "I Father" class Son(Father): i = 12345 def __init__(self): print 'this is a __init__' def sayHello(self): return 'hello world' if __name__ == '__main__': jinshan = Son() print('doc',Son.__doc__) print('name',Son.__name__) print('bases',Son.__bases__) print('dict',Son.__dict__) print('module',Son.__module__) print('class',Son.__class__)
本文出自 “专注php” 博客,请务必保留此出处http://jingshanls.blog.51cto.com/3357095/1830923
相关文章推荐
- [转]Python深复制浅复制or深拷贝浅拷贝
- Python写xml文件
- python gensim 快速模块安装方法
- python模块
- Python学习-4天--字典的操作
- Python 特殊变量
- python开发技巧---基于python3实现
- python format
- Python不能对字符解码的问题解析
- numpy KNN简单实现
- 语音合成与语音识别小例子
- Python Day1
- Python中的引用,copy和deepcopy的区别
- python 培训之Django
- Python 反射
- python(五) 对数组排序
- K折交叉验证-python
- Python用csv写入文件---消除空余行的技巧
- python打印文档字符串
- 最小二乘法 多项式曲线拟合 原理公式理解 Python 实现