python-injector / python-injector/injector

When using BoundKey inner injections are ignored

Open
#40 5 comments 0 reactions 1 assignee View on GitHub

@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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.