Powered by Tachyonic Project Luxon Framework v0.0.0

Luxon Framework for rapid application development. (luxon)

Version

Class Property

class luxon.utils.classproperty.classproperty(fget, doc=None)[source]

Similar to property decorator, but allows class-level properties.

Using @classproperty as a decorator for a member, that member can be called like a class attribute

Example

class test():

    _nug = "Default"

    def __init__(self,x):
        self._nug = x

    @classproperty
    def nug(self):
        return self._nug

   # or use it like a wrapper
   # although it only takes a getter
   # so as to make a read only property
   # nug = classproperty(nug)


print(test.nug)
test._nug = "TEST"
print(test.nug)

outputs:

Default
TEST
Class Method -> test.fnc_1()
Property -> test().fnc_2
Class Property -> test.fnc_3
deleter(fdel)[source]

Descriptor to change the deleter on a property.

getter(fget)[source]

Descriptor to change the getter on a property.

setter(fset)[source]

Descriptor to change the setter on a property.