beamlime.constructors.providers.Provider#
- class beamlime.constructors.providers.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
orpartial
as aconstructor
is forbidden similar topartial
.
Methods
__init__
(_constructor, /, *args, **kwargs)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: