Created
October 17, 2011 11:49
-
-
Save adamgoucher/1292455 to your computer and use it in GitHub Desktop.
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 foo(object): | |
def __init_(self): | |
self.content = "blah" | |
def __get__(self): | |
print(self.content) | |
def __set__(self, a, b): | |
self.a = b | |
class monkey(object): | |
bar = foo() | |
@property | |
bif = print('lollipop') | |
m = monkey() | |
# prints lollipop | |
m.bif | |
# prints blah | |
m.bar | |
# prints orange | |
m.bar = "orange" | |
m.bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment