Class ClassPropertyReadonly

class ooodev.meta.class_property_readonly.ClassPropertyReadonly(fget)[source]

Class Property. Use with @classmethod.

class C(object):
    @ClassProperty
    @classmethod
    def x(cls) -> int:
        return 1

print(C.x)
print(C().x)

Note

This class doesn’t actually work for setters, only getters.

__init__(fget)[source]