Decorator1 [Python] Decorator [Python] Decorator Decorator - Decorator : 기존 코드에 여러 기능을 덧댈 수 있는 함수 - annotation을 이용하여 사용한다. - def 함수명(func):def wrapper(): 의 형태를 갖추고 있다.12345678910111213141516171819202122232425262728#-*- coding: utf-8 -*-''' - decorator 학습하기'''def helloBye(func): def wrapper(): print "hello" # helloBye 의 인자로 전달된 함수를 호출 func() print "bye" return wrapper @helloByedef f1(): print u"f1() 함수를 수행했습니다." def f2(): pri.. 2017. 8. 16. 이전 1 다음