--- title: Decorator tags: learning notes, decorator, Python --- # Decorator * 一個函式回傳另一個函式,使用`@wrapper`語法,被視為函式的轉換,常用的範例是`@classmethod`和`@staticmethod` * 裝飾器如其名,下列兩個函式語義定義是相同的: ```python= def f(...): ... f = staticmethod(f) @staticmethod def f(...): ... ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up