8.2.4.5. Blueprint

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

Base Blueprint class.

Methods

__call__

Calls the registered Blueprint.

__delattr__

Implement delattr(self, name).

__dir__

Default dir() implementation.

__eq__

Return self==value.

__format__

Default object formatter.

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__getstate__

Helper for pickle.

__gt__

Return self>value.

__hash__

Return hash(self).

__init__

__init_subclass__

This method is called when a class is subclassed.

__le__

Return self<=value.

__lt__

Return self<value.

__ne__

Return self!=value.

__new__

__reduce__

Helper for pickle.

__reduce_ex__

Helper for pickle.

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__

Size of object in memory, in bytes.

__str__

Return str(self).

__subclasshook__

Abstract classes can override this to customize issubclass().

_set_cls

extend

Extends deferred operations calling each operation of given Blueprints.

register

Creates a Blueprint.cls and calls each deferred operation.

__init__(*args, **kwargs)[source]

Attributes

__annotations__

__dict__

__doc__

__module__

__weakref__

list of weak references to the object

cls

alias of Dispatcher

__init__(*args, **kwargs)[source]
__getstate__()[source]

Helper for pickle.

_set_cls(cls)[source]
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:
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 ...>
__call__(*args, **kwargs)[source]

Calls the registered Blueprint.

__annotations__ = {}
__doc__ = 'Base Blueprint class.'
__module__ = 'schedula.utils.blue'