가능한 중복 혼동 :
Understanding Python super()[파이썬] : 슈퍼()
클래스 B
서브 클래스 A
, B의 __init__
에서, 그래서 우리는이 같은의 __init__
를 호출해야합니다 :
class B(A):
def __init__(self):
A.__init__(self)
그러나
class B(A):
def __init__(self):
super(B, self).__init__() #or super().__init__()
내 질문
은 다음과 같습니다 :왜
super(B, self).__init__(self)
, 나는 이런 식으로 뭔가를 보았다? 반환 프록시 객체가 바운드 객체이기 때문에?super에서 두 번째 인수를 생략하고 반환 프록시 객체가 언 바운드 객체 인 경우에는
super(B).__init__(self)
을 써야하나요?
기타 여러 가지 - 먼저 검색하십시오. [어떻게 - 비단뱀 - 슈퍼 - 할 - 옳은 일] (http://stackoverflow.com/questions/607186/how-does-pythons-super-do-the-right-thing) [어떻게 - 않습니다 -python-super-work-with-multiple-inheritance] (http://stackoverflow.com/questions/3277367/how-does-pythons-super-work-with-multiple-inheritance) [usage-of-python-3 - 슈퍼] (http://stackoverflow.com/questions/2771904/usage-of-python-3- 슈퍼) – agf