Josiah Kaviani
Josiah Kaviani
Value decorator should handle async generators. As it turns out `contextlib.AsyncExitStack` can do all the cleanup job for us. All we need to do is register all context managers in...
Since the injection process will not touch this constructor, we should not restrict it. Reproduces with `Package` pointer only. Check package pointer will be resolved to class.
```python module = Package('module') class Container(Injector): foo_class = module.Foo Container.foo_class # Returns Foo class as is. ``` There is already a failing test for this (`test_provide_a_class`).
```python class SubContainer(Injector): pass class Container(Injector): sub_class = SubContainer # ------ # error ```
Passing anything except `this.something['here']` should be treated as error. Passing just `this` or `this
This will be probably an easier way to solve #432 ```python class Container(Injector): calculations = shield(list, this.calc1, this.calc2, this.calc3) calc1 = Calc1 calc2 = Calc2 calc3 = Calc3 Container.calculations #...
```python 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...
```python 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...
`Injector` is better than direct constructor call because you could easily redefine one dependency in tests on average level without coping the full constructor expression. Fake objects great. Mock is...
* https://github.com/tailhook/injections * https://github.com/ets-labs/python-dependency-injector * #8