dependencies icon indicating copy to clipboard operation
dependencies copied to clipboard

Shield object should hide *args check.

Open proofit404 opened this issue 5 years ago • 0 comments

Follow up of the #427

from dependencies import Injector, shield, this

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

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

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

Error message of ClassWithArgs should suggest shield object.

proofit404 avatar Feb 23 '21 21:02 proofit404