ivankorobkov / python-inject

Python dependency injection
Apache License 2.0
671 stars 77 forks source link

Allow provider to be a context manager (sync/async) #92

Closed fzyukio closed 7 months ago

fzyukio commented 7 months ago

Allow a provider to be used as context manager

Problem statement:

Proposed change:

Testing

ivankorobkov commented 7 months ago

Hi!

Quite an interesting change 👍. Never thought about such a case. Thank you. Could you please add comments to your code, explaining what it does? As you did in the pull request description.

Then I can merge PR and release the next version.

fzyukio commented 7 months ago

Hi @ivankorobkov thanks for checking it out. I've restructured it a bit and added some comments.

ivankorobkov commented 7 months ago

Hi, thank you.

I'll merge it tomorrow and make the next release.

ivankorobkov commented 7 months ago

Done https://pypi.org/project/inject/5.2.0/

fzyukio commented 7 months ago

@ivankorobkov Awesome! Thanks a lot for your quick action 👍