Python中多继承与super()用法Python类分为两种,一种叫经典类,一种叫新式类。两种都支持多继承。
文章目录
class A(object):
def __init__(self, *args, **kwargs):
print "args is :{}".format(*args)
print "kwargs is:{}".format(kwargs)
class B(A):
def __init__(self, *args, **kwargs):
super(B, self).__init__(*args, **kwargs)
print "B Method:{}".format(*args)
bb = B("Hello", lang="Python")
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论