Make Mypy happy (#222)

We're assigning to an attribute Mypy doesn't know about. The error it
raised:

    injector/__init__.py:862: error: "FunctionType" has no attribute "__binding__"  [attr-defined]
    Found 1 error in 1 file (checked 1 source file)
This commit is contained in:
Jakub Stasiak 2023-06-29 02:41:59 +02:00 committed by GitHub
parent d00556c898
commit f1a659c986
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -859,7 +859,7 @@ class Module:
% (function.__name__, type(self), e)
) from e
return_type = annotations['return']
binding = function.__func__.__binding__ = Binding(
binding = cast(Any, function.__func__).__binding__ = Binding(
interface=return_type, provider=binding.provider, scope=binding.scope
)
bind_method = binder.multibind if binding.is_multibinding() else binder.bind