相关疑难解决方法(0)

Python super(Class,self).method vs super(Parent,self).method

这个问题来自以下问题,我们说class B延伸class A

class A(object):
  def do_work(self):
    print 123

class B(A):
  def do_work(self):
    super(B,self).do_work() # versus the next statement
    super(A,self).do_work() # what's the difference?
Run Code Online (Sandbox Code Playgroud)

python inheritance parent super

6
推荐指数
1
解决办法
5526
查看次数

标签 统计

inheritance ×1

parent ×1

python ×1

super ×1