python-injector / python-injector/injector
[Discussion] Entering/Existing Scopes?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 94
- PR merge metrics
- No merged PRs in 30d
Description
Hi, let me start from thanking for the awesome project 🎉
Recently I was implementing a custom scope and I noticed a need for explicitly demarking beginning and ending of this scope. Mine was similar to flask_injector's RequestScope but could also be used outside web framework context, i.e. in background jobs or CLI commands.
I know injector is heavily inspired by Guice and I noticed in their documentation that their API supports enter and exit methods.
I'd like to start a brainstorming about this concept to either:
- introduce a new API for entering/exiting a scope - similar to
configure, provide emptyenter,exitmethods to be overriden, - expand documentation to give others tips to implement such a thing on their own,
- other?
BTW, here's my custom scope implementation: https://github.com/Enforcer/clean-architecture/blob/master/auctioning_platform/main/main/modules.py#L21 Basically, it's a copy-pasted ThreadLocalScope with extras.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the discussion and the linked custom scope implementation in auctioning_platform/main/main/modules.py, then compare its needs with Guice's custom-scope documentation. Done means reaching a decision on whether to add enter/exit support, expand the documentation, or pursue another direction; no specific tests or files are identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100