Skip to content

Instantly share code, notes, and snippets.

@ychennay
Created March 17, 2020 21:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ychennay/de6c9dfa2b068b3e02864078ca34d707 to your computer and use it in GitHub Desktop.
Save ychennay/de6c9dfa2b068b3e02864078ca34d707 to your computer and use it in GitHub Desktop.
Data Descriptor Behavior
student = Student()
print(f"\nFirst access of name attribute on student: {student.name}")
student.__setattr__("name", "Yu Chen")
print(f"\n{student} instance symbol table: {student.__dict__}")
print(f"\nSecond access of name attribute on student: {student.name}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment