python-injector / python-injector/injector
Child injectors should respect parent injector's multibinds
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 94
- PR merge metrics
- No merged PRs in 30d
Description
Example of a failing test case
def test_multibinds_are_extended_by_child_injectors():
parent_injector = Injector()
parent_injector.binder.multibind(List[str], to=['parent name'])
child_injector = parent_injector.create_child_injector()
child_injector.binder.multibind(List[str], to=['child name'])
assert parent_injector.get(List[str]) == ['parent name']
assert child_injector.get(List[str]) == ['parent name', 'child name'] # Currently: ['child name']
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 with the failing test test_multibinds_are_extended_by_child_injectors and trace Injector.create_child_injector(), binder.multibind(), and get(). Verify the parent injector remains unchanged while the child result contains both the parent and child bindings; the test should pass with the combined list.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100