beamlime.Provider#

class beamlime.Provider(_constructor, /, *args, **kwargs)[source]#

Function wrapper that provides certain type of product.

It is similar to partial but in addition, it contains argument or attribute dependency information of the wrapped callable object.

__init__(_constructor, /, *args, **kwargs)[source]#

Notes

Nested Provider or partial as a constructor is forbidden similar to partial.

Methods

__init__(_constructor, /, *args, **kwargs)

Notes

can_provide(product_type)

Check if the given product_type can be supported by this provider.

Attributes

call_name

constructor

can_provide(product_type)[source]#

Check if the given product_type can be supported by this provider. Product type should be the same type as the returned type of this provider. If they are not the same types, the requested product type should be the parent class of returned type of this provider.

Return type:

bool