Skip to content

Commit f1a659c

Browse files
authored
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)
1 parent d00556c commit f1a659c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

injector/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ def __call__(self, binder: Binder) -> None:
859859
% (function.__name__, type(self), e)
860860
) from e
861861
return_type = annotations['return']
862-
binding = function.__func__.__binding__ = Binding(
862+
binding = cast(Any, function.__func__).__binding__ = Binding(
863863
interface=return_type, provider=binding.provider, scope=binding.scope
864864
)
865865
bind_method = binder.multibind if binding.is_multibinding() else binder.bind

0 commit comments

Comments
 (0)