eradiate._factory#

List of Factory instances#

Classes#

class eradiate._factory.Factory(registry=NOTHING)[source]#

Object factory.

This factory subclass extends the original dessinemoi.Factory type by adding the following functionality to its convert() 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 (list of tuple[str, str, dict]) – A list of (cls, type_id, kwargs) tuples where cls is the name of the target type (relative to cls_prefix), type_id is the ID for the registered type and kwargs is a dictionary containing keyword arguments for the Factory.register() method.

  • cls_prefix (str) – A prefix relative to which lazy type names are expressed.