Skip to content

Instantly share code, notes, and snippets.

@ychennay
Created March 17, 2020 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ychennay/d587cb27aef010d71aba5747057e4843 to your computer and use it in GitHub Desktop.
Save ychennay/d587cb27aef010d71aba5747057e4843 to your computer and use it in GitHub Desktop.
Example of non-data descriptor behavior
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