Skip to content

Instantly share code, notes, and snippets.

@adamgoucher
Created October 17, 2011 11:49
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 adamgoucher/1292455 to your computer and use it in GitHub Desktop.
Save adamgoucher/1292455 to your computer and use it in GitHub Desktop.
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