Skip to content

Instantly share code, notes, and snippets.

@vmaks
Created February 28, 2015 19:19
Show Gist options
  • Save vmaks/79fac700f429dc4294a3 to your computer and use it in GitHub Desktop.
Save vmaks/79fac700f429dc4294a3 to your computer and use it in GitHub Desktop.
Python class property([fget[, fset[, fdel[, doc]]]])
# link: https://docs.python.org/2/library/functions.html
class C(object):
def __init__(self):
self._x = None
@property
def x(self):
"""I'm the 'x' property."""
return self._x
@x.setter
def x(self, value):
self._x = value
@x.deleter
def x(self):
del self._x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment