Skip to content

Instantly share code, notes, and snippets.

@bogsio
Created October 28, 2013 19:31
Show Gist options
  • Save bogsio/7203080 to your computer and use it in GitHub Desktop.
Save bogsio/7203080 to your computer and use it in GitHub Desktop.
Understanding Python descriptors #3
user1 = User()
user1.email = '123' # Throws exception
user1.email = 'bogdan@mail.com'
print user1.email # bogdan@mail.com
user2 = User()
user2.email = 'example@mail.com'
print user2.email # example@mail.com
print user1.email # example@mail.com !!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment