다중상속1 super()메소드와 다중상속 1.super() 메소드 super()는 파이썬의 내장 함수로서, 상속과 관련된 작업을 수행할 때 사용됩니다. 특히, 자식 클래스에서 부모 클래스의 메서드를 호출할 때 사용됩니다. super()의 주요 목적은 자식 클래스에서 부모 클래스의 메서드를 오버라이드(재정의)하면서도 그 오버라이드된 메서드 내에서 부모 클래스의 원본 메서드를 호출하는 것입니다. class Parent: def hello(self): print('Hello from Parent class') class Child(Parent): def hello(self): super().hello() print('Hello from Child class') c = Child() c.hello() Hello from Parent class Hell.. 2023. 9. 13. 이전 1 다음