jgdv.structs.strang.code_ref
Type Aliases
Classes
A reference to a class or function. |
Module Contents
- jgdv.structs.strang.code_ref.CheckType: TypeAlias = type | types.UnionType
- class jgdv.structs.strang.code_ref.CodeReference(
- *args,
- value=None,
- check=None,
- **kwargs,
Bases:
jgdv.structs.strang.strang.StrangA reference to a class or function.
can be created from a string (so can be used from toml), or from the actual object (from in python)
Has the form:
[cls::]module.a.b.c:ClassName
Can be built with an imported value directly, and a type to check against
__call__ imports the reference
- Parameters:
args (Any)
value (jgdv.Maybe)
check (jgdv.Maybe[CheckType | CheckCancel])
kwargs (Any)
- _check_imported_type(check=None) <Unknown>[source]
- Parameters:
check (jgdv.Maybe[CheckType | CheckCancel])
- Return type:
None
- _do_import(*, check=None) <Unknown>[source]
- Parameters:
check (jgdv.Maybe[CheckType | CheckCancel])
- Return type:
Any
- expects_type(*args) <Unknown>[source]
- Parameters:
args (jgdv.Maybe[CheckType | CheckCancel])
- Return type:
jgdv.Maybe[CheckType]
- to_alias(group, plugins) <Unknown>[source]
TODO Given a nested dict-like, see if this reference can be reduced to an alias
- abstractmethod to_uniq(*args) <Unknown>[source]
Generate a concrete instance of this name with a UUID prepended,
ie: a.task.group::task.name..{prefix?}.$gen$.<UUID>
- Parameters:
args (str)
- Return type:
Never
- _check: jgdv.Maybe[CheckType]
- _formatter: ClassVar
- _processor: ClassVar
- _sections: ClassVar
- _value = None