Skip to content

Commit

Permalink
Make Mypy happy (#222)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
jstasiak committed Jun 29, 2023
1 parent d00556c commit f1a659c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion injector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ def __call__(self, binder: Binder) -> None:
% (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
Expand Down

0 comments on commit f1a659c

Please sign in to comment.