Skip to content

Instantly share code, notes, and snippets.

@imteekay
Last active December 27, 2018 14:43
Show Gist options
  • Save imteekay/f2855b3bb7272776a7f098610f1a3fe6 to your computer and use it in GitHub Desktop.
Save imteekay/f2855b3bb7272776a7f098610f1a3fe6 to your computer and use it in GitHub Desktop.
tk = Person('TK', 'tk@mail.com')
print(tk.email()) # => tk@mail.com
# tk._email = 'new_tk@mail.com' -- treat as a non-public part of the class API
print(tk.email()) # => tk@mail.com
tk.update_email('new_tk@mail.com')
print(tk.email()) # => new_tk@mail.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment