Created
September 14, 2019 14:08
-
-
Save vubon/46bf9607ea361f2ab20befd94b4d83d7 to your computer and use it in GitHub Desktop.
Python Property function part 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ....... | |
# Just declare the @property decorator and solve those problems. | |
@property | |
def account_information(self) -> dict: | |
""" | |
Get account information | |
:return: {'bank_account': '0004-0067894712', 'balance': 1000.5} | |
:rtype: dict | |
""" | |
return dict(bank_account=self.bank_account, balance=self.balance) | |
# ....... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment