mirror of
https://git.wownero.com/lza_menace/wownero-python.git
synced 2024-08-15 03:25:25 +00:00
12e69da496
* continuous integration goodies * fixed test_address not running * fixup `python setup.py test` * fixup readme.rst formatting
14 lines
407 B
Python
14 lines
407 B
Python
class ClassPropertyDescriptor(object):
|
|
"""Based on https://stackoverflow.com/questions/5189699/how-to-make-a-class-property"""
|
|
|
|
def __init__(self, fget):
|
|
self.fget = fget
|
|
|
|
def __get__(self, obj, klass):
|
|
if klass is None:
|
|
klass = type(obj)
|
|
return self.fget.__get__(obj, klass)()
|
|
|
|
|
|
def classproperty(func):
|
|
return ClassPropertyDescriptor(classmethod(func))
|