7.2.4.2. Blueprint

class Blueprint(*args, **kwargs)[source]

Base Blueprint class.

Methods

__init__ Initialize self.
extend Extends deferred operations calling each operation of given Blueprints.
register Creates a Blueprint.cls and calls each deferred operation.
__init__(*args, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

cls

alias of schedula.dispatcher.Dispatcher

register(obj=None, memo=None)[source]

Creates a Blueprint.cls and calls each deferred operation.

Parameters:
  • obj (object) – The initialized object with which to call all deferred operations.
  • memo (dict[Blueprint,T]) – A dictionary to cache registered Blueprints.
Returns:

The initialized object.

Return type:

Blueprint.cls | Blueprint

——————————————————————–

Example:

>>> import schedula as sh
>>> blue = sh.BlueDispatcher().add_func(len, ['length'])
>>> blue.register()
<schedula.dispatcher.Dispatcher object at ...>
extend(*blues, memo=None)[source]

Extends deferred operations calling each operation of given Blueprints.

Parameters:
  • blues (Blueprint | schedula.dispatcher.Dispatcher) – Blueprints or Dispatchers to extend deferred operations.
  • memo (dict[T,Blueprint]) – A dictionary to cache Blueprints.
Returns:

Self.

Return type:

Blueprint

——————————————————————–

Example:

>>> import schedula as sh
>>> blue = sh.BlueDispatcher()
>>> blue.extend(
...     BlueDispatcher().add_func(len, ['length']),
...     BlueDispatcher().add_func(callable, ['is_callable'])
... )
<schedula.utils.blue.BlueDispatcher object at ...>