Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e9c1274 commit 09a0db0Copy full SHA for 09a0db0
1 file changed
mypy/checker.py
@@ -6736,7 +6736,8 @@ def narrow_type_by_identity_equality(
6736
# However, for non-value targets, we cannot do this narrowing,
6737
# and so we ignore else_map
6738
# e.g. if (x: str | None) != (y: str), we cannot narrow x to None
6739
- all_if_maps.append(if_map)
+ if if_map is not None: # TODO: this is incorrect
6740
+ all_if_maps.append(if_map)
6741
6742
# Handle narrowing for operands with custom __eq__ methods specially
6743
# In most cases, we won't be able to do any narrowing
0 commit comments