ivankorobkov / python-inject

Python dependency injection
Apache License 2.0
671 stars 77 forks source link

Using decorator results in errors about untyped decorators #106

Open ShravanSunder opened 3 days ago

ShravanSunder commented 3 days ago

With pylance (strict) i'm getting errors with injector decorators.

2024-07-04 0736 Brave Browser ivankorobkovpython-inject Python dependency injection

It doesn' tlook like the any paramspec or typevars in the definition

def params(**args_to_classes: Binding) -> Callable:
    """Return a decorator which injects args into a function.

    For example::

        @inject.params(cache=RedisCache, db=DbInterface)
        def sign_up(name, email, cache, db):
            pass
    """
    return _ParametersInjection(**args_to_classes)