Last active
July 12, 2017 22:21
-
-
Save anaved/925df723a4c290392f6611bc707a1cb8 to your computer and use it in GitHub Desktop.
Example of how to get/set/delete a property.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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