Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Content-Length: 267056 | pFad | http://github.com/ets-labs/python-dependency-injector/discussions/758
FAFetched URL: http://github.com/ets-labs/python-dependency-injector/discussions/758
Alternative Proxies:
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Can you please point me to the place in documentation explaining how to use this in a Python module, i.e. in a file I use as an
import
?So far I could easily find the
if __name__ == "__main__":
stuff which is for standalone applications.What about supporting injection in an 'importable' module?
The use-case: I'm working on an AWS lambda and my code won't ever be run by itself, it will always be imported into another code (which I have no control over) and the lambda handler function will be called from there.
Is there any way to have everything instantiated/injected when my 'entry point function' gets called by external code?
All tutorials seem to be about standalone apps.
But if I initialize dependency injection in my main module (outside of the 'entry point function') then I'm confused about unit-testing.
Beta Was this translation helpful? Give feedback.
All reactions