Skip to content

Commit

Permalink
Silence one mypy false positive
Browse files Browse the repository at this point in the history
See python/mypy#5354 for details.
  • Loading branch information
jstasiak committed Sep 19, 2018
1 parent 69f1ab8 commit 2c30c77
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion injector.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,10 @@ def _infer_injected_bindings(callable):
union_members = v.__union_params__
new_members = tuple(set(union_members) - {type(None)})
new_union = Union[new_members]
bindings[k] = new_union
# mypy complains about this construct:
# error: The type alias is invalid in runtime context
# See: https://github.com/python/mypy/issues/5354
bindings[k] = new_union # type: ignore

return bindings

Expand Down

0 comments on commit 2c30c77

Please sign in to comment.