Created
November 8, 2011 16:59
-
-
Save Lothiraldan/1348368 to your computer and use it in GitHub Desktop.
Setattr and properties
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
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