Josiah Kaviani
Josiah Kaviani
`shield` object does not exist at the moment we implemented positional check in #360
The first argument of the shield object should be a class. Functions or other objects are not allowed.
If we wrote `shield(ClassWithKwargs, x=this.x, y=this.y)` then `ClassWithKwargs` should has `**kwargs` in it signature.
If we wrote `shield(ClassWithArgs, this.x, this.y)` then `ClassWithArgs` should has `*args` in it signature.
```python class Foo: def __init__(self, a, b, **kwargs): ... class Container(Injector): foo = shield(Foo, a=this.a) # -------- error ```
Follow up of the #427 ```python from dependencies import Injector, shield, this class ClassWithKwargs: def __init__(self, x, y, **kwargs): ... class Container(Injector): foo = shield(ClassWithKwargs) x = 1 y =...
Follow up of the #427 ```python from dependencies import Injector, shield, this class ClassWithArgs: def __init__(self, x, y, *args): ... class Container(Injector): foo = shield(ClassWithArgs) x = 1 y =...
Supersedes #289 ```python @attrs class Book: title = attrib() author = attrib() def is_written_by(self, writer): return self.author == writer @attrs class LoggedBook: book = attrib() logger = attrib() def is_written_by(self,...
#### Problem ```python >>> from dependencies import Injector, pluck, this >>> class Foo: ... def __init__(self, bar): ... self.bar = bar ... ... def do(self): ... return self.bar + '1'...