摘要: super() 的入门使用在类的继承中,如果重定义某个方法,该方法会覆盖父类的同名方法,但有时,我们希望能同时实现父类的功能,这时,我们就需要调用父类的方法了,可通过使用 super 来实现,比如:class Animal(object): def _... 阅读全文
posted @ 2018-10-07 16:38 luoganttcc 阅读(68) 评论(0) 推荐(0) 编辑
摘要: super的作用是降低多继承时的算法复杂度,和什么父类没有关系class A: def __init__(self): print("Enter A") print("Leave A")class B(A): def __init__(sel... 阅读全文
posted @ 2018-10-07 16:31 luoganttcc 阅读(87) 评论(0) 推荐(0) 编辑