Skip to content

Instantly share code, notes, and snippets.

@bhgomes
Created March 26, 2019 22:52
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 bhgomes/57b5f40871d8e9859e431dce7f44732a to your computer and use it in GitHub Desktop.
Save bhgomes/57b5f40871d8e9859e431dce7f44732a to your computer and use it in GitHub Desktop.
classproperty
class classproperty(property):
"""Class Property."""
def __get__(self, obj, objtype=None):
"""Wrap Getter Function."""
return super().__get__(objtype)
def __set__(self, obj, value):
"""Wrap Setter Function."""
return super().__set__(type(obj), value)
def __delete__(self, obj):
"""Wrap Deleter Function."""
super().__delete__(type(obj))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment