Skip to content

Instantly share code, notes, and snippets.

@aliwo
Last active May 24, 2019 03:15
Show Gist options
  • Save aliwo/7f29c2d2f8be0dc60d19ccfa28f7c891 to your computer and use it in GitHub Desktop.
Save aliwo/7f29c2d2f8be0dc60d19ccfa28f7c891 to your computer and use it in GitHub Desktop.
할리우드 법칙
class Mother:
my_varialbe = 3
def _func(self):
print('func 호출')
def func_caller(self):
print('여기에 로그를 쓰면 됩니다: {}'.format(self.my_variable))
self.func()
class ChildA:
def _func(self):
print('자식 A의 func 호출')
# 실제로 _func 를 호출하고 싶을땐, 오버라이딩 되지 않은 func_caller() 를 호출한다!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment