injector icon indicating copy to clipboard operation
injector copied to clipboard

Python dependency injection framework, inspired by Guice

Results 54 injector issues
Sort by recently updated
recently updated
newest added

Highlight that the code snippet will not work. Most of the time users will simply skim read the docs trying to spot snippets on how to use the code. Since...

**Edit:** This post originally had a question on how to solve a specific problem, but is updated with the solution and requested change described in https://github.com/alecthomas/injector/issues/116#issuecomment-647505337: Injector should require a...

Adds the `MultiBindClassProvider` which provides instances of classes from a list of class types when using the `multibind` API. Resolves #45

Hi there, currently upgrading a project using injector to python 3.8. We use MyPy generics in our project and I discovered that I can no longer inject my generic class....

It's not an issue rather a question. I hope you won't mind me posting it. I'm trying to figure out what would be the best way to use the injector...

Unless I am doing something wrong, I will expect following binding to get single instance, but I am getting two different instances: Code (python3): ``` #!/usr/bin/env python3 import abc import...

Separated out from #168 - specifically to deal with binding to a class level Protocol usage (i.e normal methods defined in the protocol rather than the special `__call__()` usage. This...

Hiya, I understand that `Key` has been removed from the library. This took me a bit of headscratching to figure out! I was following https://github.com/alecthomas/injector/blob/master/docs/terminology.rst Github won't let me easily...

The type annotation for `Binder.bind` is as follows: ```python def bind( self, interface: Type[T], to: Union[None, T, Callable[..., T], Provider[T]] = None, scope: Union[None, Type['Scope'], 'ScopeDecorator'] = None, ) ->...