我正在寻找一个不错的库来在 Python 中实现控制反转和依赖注入。我发现正在测试这 2 个项目,但想问一下您是否对其中任何一个有任何经验或更好的建议:
注入: https://pypi.org/project/Inject/
依赖注入器: https://python-dependency-injector.ets-labs.org/introduction/index.html
谢谢。
我们一直在使用的是python-injector,它正在积极开发:https://github.com/python-injector/injector