fuction: decorator, dispatch
decorator
- '공통 함수' 작성 -> 코드 재사용성

none_doce(5)
를 해야 진짜 실행된다. (불편.. 그래서 decorator
실행됨)
- decorator

dispatch(오버로딩)
from multipledispatch import dispatch
@dispatch(list)
def gen(arg_list: list):
print(arg_list)
@dispatch(str)
def gen(string: str):
print(string)
if __name__ == '__main__':
gen([1,2,3,4,5])
gen('hello')

Author And Source
이 문제에 관하여(fuction: decorator, dispatch), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://velog.io/@markyang92/fuction-decorator-dispatch
저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)

none_doce(5)
를 해야 진짜 실행된다. (불편.. 그래서decorator
실행됨)

from multipledispatch import dispatch
@dispatch(list)
def gen(arg_list: list):
print(arg_list)
@dispatch(str)
def gen(string: str):
print(string)
if __name__ == '__main__':
gen([1,2,3,4,5])
gen('hello')
Author And Source
이 문제에 관하여(fuction: decorator, dispatch), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@markyang92/fuction-decorator-dispatch저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)