Created
March 17, 2020 22:42
-
-
Save ychennay/d587cb27aef010d71aba5747057e4843 to your computer and use it in GitHub Desktop.
Example of non-data descriptor behavior
This file contains 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
print(f"\nFirst access of grade attribute on student: {student.grade}") | |
student.__setattr__("grade", 12) | |
print(f"\n{student} instance symbol table: {student.__dict__}") | |
print(f"\nSecond access of grade attribute on student: {student.grade}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment