Skip to content

Instantly share code, notes, and snippets.

@a-square
Created December 21, 2016 10:22
Show Gist options
  • Save a-square/cf46fc64d649379ea41c79fd941d8f39 to your computer and use it in GitHub Desktop.
Save a-square/cf46fc64d649379ea41c79fd941d8f39 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
class Prop:
def __get__(self, instance, owner):
return 'foo'
class Foo:
foo = Prop()
x = Foo()
x.foo = 'bar'
print(x.foo)
def set_foo(self, instance, value):
pass
Prop.__set__ = set_foo
print(x.foo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment