devana.utility
devana.utility.errors
devana.utility.fakeenum
devana.utility.init_params
- init_params(skip=None)[source]
A decorator that automatically assigns classmethod parameters to instance attributes, if the attribute has a setter or exists as an instance variable.
Parameters in the skip set will be ignored, “cls” is ignored by default. If parameter is not settable or doesn’t exist in the instance, an AttributeError will be raised.
Example usage:
class Person: name: str = "" age: int = 0 @classmethod @init_params() def create(cls, name: str, age: int): return cls() jerry = Person.create("Jerry", 20) print(jerry.name, jerry.age) # Outputs: Jerry 20
- Return type
Callable
devana.utility.lazy
devana.utility.traits
- class IBasicCreatable[source]
Bases:
IDefaultCreatable
,IFromCursorCreatable
,IFromParamsCreatable
,ABC
An interface that describes a set of constructors for a code element.
- class ICursorValidate[source]
Bases:
ABC
An interface that specifies that an object can only work with certain types of clang cursors.
- class IDefaultCreatable[source]
Bases:
ABC
The interface of an object that can be created with default sets of values.
- class IFromCursorCreatable[source]
Bases:
ABC
The interface of an object that can be created from many clang cursor.
devana.utility.typeregister
- register(current_register)[source]
Registers a type in the given variable - usually a global module variable. Useful for automatically creating lists of default supported classes, etc.
Sets of utility classes.