-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
It would be great to be possible to declare more than one provider bound to the same "bound_type".
Something like:
class UseCase:
def __init__(self, some_type: SomeType):
...
class Dependencies(Group):
some_type = providers.Factory(
creator=some_creator,
bound_type=SomeType,
#qualifier=None # Default, the "primary"
)
another_type = providers.Factory(
creator=some_another_creator,
bound_type=SomeType,
qualifier="another"
)
class Usage(Group):
my_use_case = providers.Factory(
creator=UseCase,
)
some_other_use_case = providers.Factory(
creator=UseCase,
qualifiers={
SomeType: "another"
}
)
# Resolve directly with container
container.resolve(SomeType, qualifier="another")Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels