modern-python / that-depends

DI-framework, inspired by python-dependency-injector, but without wiring. Python 3.12 is supported
https://that-depends.readthedocs.io/
MIT License
133 stars 10 forks source link

Injecting factory itself #27

Closed lesnik512 closed 3 months ago

lesnik512 commented 3 months ago

Described here.

Can be implemented by adding property provider as in PDI. This property will return a factory object which must be called without args.

Opened question: should this factory be callable or awaitable. If callable, than async resources must be preinitialized

vrslev commented 3 months ago

Opened question: should this factory be callable or awaitable. If callable, than async resources must be preinitialized

We can add both: .provider and .sync_provider.

vrslev commented 3 months ago

Rhymes with resolve() and sync_resolve().