본문 바로가기
파이썬

python의 super() 함수 란?

by 책 읽는 개발자_테드 2019. 4. 4.
반응형

python 공식 Document의 내용에 따르면 정의는 다음과 같다.

 

super([type[, object-or-type]])

Return a proxy object that delegates method calls to a parent or sibling class of type. This is useful for accessing inherited methods that have been overridden in a class. The search order is same as that used by getattr() except that the type itself is skipped.

 

 프록시 객체를 반환한다. 이것은 부모 또는 형재 클래스에게 메소드 콜을 위임한다. 이것은 클래스에서 재 정의 된, 상속 메소드에 엑세스 할 때 유용하다. 검색 순서는 getattr ()이 사용하는 검색 순서와 동일하지만 type 자체는 제외한다.

 

#자식클래스에서 부모 클래스의 내용을 사용할 수 있다.

 

출처

파이썬 공식 문서:https://docs.python.org/3/library/functions.html?highlight=super#super

파이썬으로 배우는 웹 크롤러(서적)

 

반응형

댓글