Created
January 13, 2016 01:55
-
-
Save devoto13/30dcc0ac2c288cc0e459 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
In [2]: class Test(object): | |
def __setattr__(self, name, value): | |
print(name, "changed to", value) | |
super().__setattr__(name, value) | |
...: | |
In [3]: t = Test() | |
In [4]: t.name = 4 | |
name changed to 4 | |
In [5]: t.name = 5 | |
name changed to 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment