Skip to content

Instantly share code, notes, and snippets.

@mingyc
Created March 22, 2012 11:34
Show Gist options
  • Save mingyc/2157821 to your computer and use it in GitHub Desktop.
Save mingyc/2157821 to your computer and use it in GitHub Desktop.
An example of the usage of property() as decorator.
class Circle(object):
def __init__(self, radius):
self._radius = radius
@property
def radius(self):
return self._radius
@radius.setter
def radius(self, value):
self._radius = value
@radius.deleter
def radius(self):
del self._radius
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment