dependencies
dependencies copied to clipboard
Shield object should pass keyword arguments.
from dependencies import Injector, shield, this
class ClassWithKwargs:
def __init__(self, **kwargs):
...
class Container(Injector):
foo = shield(ClassWithKwargs, x=this.x, y=this.y)
x = 1
y = 2
Container.foo # will pass x and y to the class **kwargs