您的位置:首页 > 编程语言 > Python开发

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: