Skip to content

Instantly share code, notes, and snippets.

@Lothiraldan
Created November 8, 2011 16:59
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 Lothiraldan/1348368 to your computer and use it in GitHub Desktop.
Save Lothiraldan/1348368 to your computer and use it in GitHub Desktop.
Setattr and properties
def __setattr__(self, index, value):
# Hack for properties setter
if hasattr(getattr(self.__class__, index, None), '__get__'):
return object.__setattr__(self, index, value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment