I see that containers.pyi declares Container class but it seems that containers don't have Container parent at all.
Yep, Container is just a typing stub, not a real class. I think creating just an empty class should be enough to keep using the stub for typing and not failing in runtime.
If you could make a pull request, it would be awesome. Use "develop" as a target branch.
Btw, starting from version 4.14.0 you don't need to have these recursive functions. When you call .init_resources() on root container, it will initialize all nested resources. The same for shutdown. If you have other recursive functions, see new feature: https://python-dependency-injector.ets-labs.org/containers/traversal.html
Hey!
I am trying to add type annotations to my Python code wherever I can. I created simple functions to init/shutdown resources in nested containers:
I see that
containers.pyi
declaresContainer
class but it seems that containers don't haveContainer
parent at all.I can prepare PR with abstract
Container
class.The text was updated successfully, but these errors were encountered: