Python屬性 === * **Instance Attribute** * 透過點\(`.`\)的語法或在建構式\(Constructor\)中所生成的屬性\(Attribute\) * **Class Attribute** * 在建構式\(Constructor\)之外的屬性\(Attribute\),相當於Swift的`static`變數 * **Property Attribute** * 在method前加上`@property`或`@property.setter`,稱之property裝飾詞\(@property Decorator\)告訴類別\(Class\)當來源端要設定屬性值時,要呼叫這個方法\(Method\) ## Ref. [https://www.learncodewithmike.com/2020/01/python-attribute.html](https://www.learncodewithmike.com/2020/01/python-attribute.html) ###### tags: `語法相關`
×
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