Abstract class properties#

Multiple solutions on how to enforce an abstract class property on an object. Generic types like ‘List[int]’ are not allowed, because the don’t work well with the isinstance()-like methods.

sigmaepsilon.core.acp.abstract_class_property(**kwargs) Callable[source]#

A decorator to achieve similar behaviour to the property decorator, but for classes.

Example

>>> class MyClasss:
>>>     _my_property = 1
>>>
>>>     @classproperty
>>>     def prop(cls):
>>>         return cls._my_property