python-injector / python-injector/injector
When using BoundKey inner injections are ignored
Open
@jstasiak is already working on this.
Since Apr 9, 2014.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 94
- PR merge metrics
- No merged PRs in 30d
Description
The following test demonstrates the problem:
>>> from injector import *
>>> class A(object):
... @inject(x=InstanceProvider(0))
... def __init__(self, x=-1, a=-2):
... print x, a
...
>>> inj = Injector()
>>> inj.get(A)
0 -2
<__main__.A object at 0x1f977d0>
>>> inj.get(BoundKey(A, a=InstanceProvider(1)))
-1 1
<__main__.A object at 0x1f97850>
The expected output in the last case should be 0 1, right?
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.
Assessment
This issue has not been assessed yet.