Skip to content

Instantly share code, notes, and snippets.

@anaved
Last active July 12, 2017 22:21
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 anaved/925df723a4c290392f6611bc707a1cb8 to your computer and use it in GitHub Desktop.
Save anaved/925df723a4c290392f6611bc707a1cb8 to your computer and use it in GitHub Desktop.
Example of how to get/set/delete a property.
class MyProperty(object):
def __init__(self, name):
self.__name = name
@property
def xname(self):
return self.__name
@xname.setter
def xname(self, val):
self.__name = val
@xname.deleter
def xname(self):
del self.__name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment