Python Dependency Injection Framework

后端 未结 18 2168
你的背包
你的背包 2020-12-12 14:10

Is there a framework equivalent to Guice (http://code.google.com/p/google-guice) for Python?

18条回答
  •  攒了一身酷
    2020-12-12 14:15

    I'm actively developing pinject for Python >= 3.6. It's quite easy to use:

    class MyObject:
        my_service: MyService = INJECTED
        my_config: str = INJECTED
    

提交回复
热议问题