pcah/python-clean-architecture

DI: Container - passing kwargs for constructor during registration

jakos opened this issue · 1 comments

jakos commented

kwargs should by optional

Example:

# configuration.py
Container.register_by_interface(interface=HeaterInterface, constructor=Heater, kwargs={'sth': True})
Container.register_by_name(name='a_pump', constructor=Pump, kwargs={'sth': False})
lhaze commented

@jakos I'm sorry, I have to retake this issue. I can't wait any more.