RE-CONSIDER-ED
  • Business
  • Data
  • Books
  • Life
Sign in Subscribe

Decorator

Python Decorator(데코레이터)

왜 데코레이터를 사용할까? * 데코레이터는 함수를 수정하지 않은 상태에서 추가 기능을 구현할 때 사용 As-Is def hello():     print('hello 함수 시작')     print('hello')     print('hello 함수 끝')   def world():     print('world 함수 시작')     print('world')     print('world 함수 끝')   hello() world() To-Be def trace(func):                             # 호출할 함수를 매개변수로 받음     def wrapper(
Bongho, Lee 2022년 4월 22일

Subscribe to RE-CONSIDER-ED

Don't miss out on the latest news. Sign up now to get access to the library of members-only articles.
  • Sign up
  • About
RE-CONSIDER-ED © 2023. Powered by Ghost