강의

멘토링

로드맵

Inflearn Community Q&A

wldls3173022's profile image
wldls3173022

asked

Type Python! Correct class usage and object-oriented programming

Decorator pattern basics

데코레이터 관련 질문입니다!

Written on

·

189

1

- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요!
- 먼저 유사한 질문이 있었는지 검색해보세요.
- 서로 예의를 지키며 존중하는 문화를 만들어가요.
- 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.
 
def copyright(func): #이 func 인자에는 여러 함수가 들어갈 수 있을 것임 def new_func(): print("@") func() return new_func def smile(): print("^0^") def angry(): print("ff") def love(): print("love") copyright(smile()) copyright(angry()) copyright(love())
 
왜 이 코드를 실행하면,
@는 같이 붙어있지 않고,
^0^
ff
love
만 결과로 나오는 것인가요?
ooppython

Answer 1

0

amamov님의 프로필 이미지
amamov
Instructor

안녕하세요!

코드를 확인하기가 어려운데 혹시 코드 사진을 올려주실 수 있을까요?

바로 도움 드리겠습니다 :)

wldls3173022's profile image
wldls3173022

asked

Ask a question