Skip to content

Instantly share code, notes, and snippets.

@jqb
Created February 26, 2013 15:41
Show Gist options
  • Save jqb/5039424 to your computer and use it in GitHub Desktop.
Save jqb/5039424 to your computer and use it in GitHub Desktop.
Nice pattern for clean property definiiton
class Class(object):
def prop(self):
def fget(self):
# stuff to get the value
def fset(self, value):
# stuff to set the value
return locals()
prop = property(**prop())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment