eradiate._factory#
List of Factory instances#
Classes#
- class eradiate._factory.Factory(registry=NOTHING)[source]#
Object factory.
This factory subclass extends the original
dessinemoi.Factorytype by adding the following functionality to itsconvert()method:unit interpretation using
pinttr.interpret_units();class method constructor selection using the
"construct"key (overrides the default dict constructor if any; reserves the"construct"parameter).
The interface is unchanged.
- register_lazy_batch(specs, cls_prefix='')[source]#
Register multiple lazy types at once.
- Parameters:
specs (
listoftuple[str,str,dict]) – A list of(cls, type_id, kwargs)tuples whereclsis the name of the target type (relative to cls_prefix),type_idis the ID for the registered type andkwargsis a dictionary containing keyword arguments for theFactory.register()method.cls_prefix (
str) – A prefix relative to which lazy type names are expressed.