1. 다중 상속

https://dojang.io/mod/page/view.php?id=2388 https://www.delftstack.com/ko/howto/python/nested-class-in-python/

# 다이아몬드 상속

class die_a_mond:
    def test(self):
        print('다이아몬드 테스트 중')

class Person(die_a_mond):
    def greeting(self):
        print('안녕하세요.')
 
class University(die_a_mond):
    def manage_credit(self):
        print('학점 관리')
 
class Undergraduate(Person, University):
    def study(self):
        print('공부하기')
           # 공부하기: 파생 클래스 Undergraduate에 추가한 study 메서드

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/307320d4-cc22-4fdf-b274-60be1633a68c/Untitled.png

2. 중첩 클래스

https://www.delftstack.com/ko/howto/python/nested-class-in-python/

class Dept:
    def __init__(self, dname):
        self.dname = dname

    class Prof:
        def __init__(self,pname):
            self.pname = pname
            
math = Dept("Mathematics")
mathprof = Dept.Prof("Mark")
test = Dept('test_init')
test2 = Dept.Prof('test_init')
print(test.dname)
print(test2.pname)

>>> print
test_init
test_init