Created
March 26, 2019 22:52
-
-
Save bhgomes/57b5f40871d8e9859e431dce7f44732a to your computer and use it in GitHub Desktop.
classproperty
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
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