dependencies icon indicating copy to clipboard operation
dependencies copied to clipboard

Shield object should hide **kwargs check.

Open proofit404 opened this issue 5 years ago • 0 comments

Follow up of the #427

from dependencies import Injector, shield, this

class ClassWithKwargs:
    def __init__(self, x, y, **kwargs):
        ...

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

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

Error message of ClassWithKwargs should suggest shield object.

proofit404 avatar Feb 23 '21 21:02 proofit404