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

Typo https://github.com/alecthomas/injector/blob/d31b83ffcc6c6eaa9a9a0fd4711d1f2e0585a1f3/injector/__init__.py#L801 introduced by https://github.com/alecthomas/injector/commit/d31b83ffcc6c6eaa9a9a0fd4711d1f2e0585a1f3.

Hi, what are the best practices for inject in celery tasks? ```python from celery import shared_task class FooService: @inject def __init__(bar: Bar): self.bar = bar def run_method() pass @shared_task(name='foo_task') def...

Case: ``` class TokenService(metaclass=ABCMeta): @abstractmethod def authorize_token(self, auth_header: str) : pass @singleton class JWTTokenService(TokenService): ... ``` JWTTokenService is the default implementation for TokenService, even if it has multiple implementations. For...

In an attempt to abstract away the concrete logger implementation, I'd like to inject logger objects into my classes. However, I would also like the `name` of the injected logger...

Hello! I added support for default scope to injector. This removes a lot of boiler plate, in projects that use other scopes than NoScope by default. For example, a lot...

I'd like to configure Injector to ignore all constructor parameters that are typed with `str`, `int` or `bool`. Is this possible? Right now I have to leave off the type...

As per injector/__init__.py: ``` # Copyright (C) 2010 Alec Thomas # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should...

Manually bound `Key`s end up caching a value you might expect to be thread local with `ThreadLocalScope`. The problem is that for manually bound items, a `InstanceProvider(to)` is created. Then...

Hi there, first of all thanks for providing a great project here, coming from c# background, its been the backbone of all of my python projects so far. At the...

The following test demonstrates the problem: ``` python >>> from injector import * >>> class A(object): ... @inject(x=InstanceProvider(0)) ... def __init__(self, x=-1, a=-2): ... print x, a ... >>> inj...