dependencies icon indicating copy to clipboard operation
dependencies copied to clipboard

Shield object should pass positional arguments.

Open proofit404 opened this issue 5 years ago • 0 comments

from dependencies import Injector, shield, this

class ClassWithArgs:
    def __init__(self, *args):
        ...

class Container(Injector):
    foo = shield(ClassWithArgs, this.x, this.y)
    x = 1
    y = 2

Container.foo  # will pass x and y to the class *args

proofit404 avatar Jan 26 '21 12:01 proofit404