Skip to content

Instantly share code, notes, and snippets.

@jeetsukumaran
Created June 8, 2019 16:35
Show Gist options
  • Select an option

  • Save jeetsukumaran/9c33e7fdb0ae4b2cc6104e779f0e47a1 to your computer and use it in GitHub Desktop.

Select an option

Save jeetsukumaran/9c33e7fdb0ae4b2cc6104e779f0e47a1 to your computer and use it in GitHub Desktop.
#! /usr/bin/env python
# -*- coding: utf-8 -*-
class A(object):
def __init__(self):
self._foo = None
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
return locals()
foo = property(**foo())
a = A()
print(a.foo)
a.foo = "hello"
print(a.foo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment