You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that v1.8.0 regressed in how it handles type checking with returned match objects from Python's regex stdlib.
It now flags unreachable code when checking on the truthyness of a regex match return value.
Bug Report
It seems that v1.8.0 regressed in how it handles type checking with returned match objects from Python's regex stdlib.
It now flags unreachable code when checking on the truthyness of a regex match return value.
This was not the case in v1.7.x
To Reproduce
Results in:
Changing the line to explicitly cast it as a boolean avoids this:
or:
This seems to be related to the config setting of
strict_optional = False
Expected Behavior
I would not expect any unreachable lines in this example.
Actual Behavior
mypy 1.8.0 reports an unreachable violation.
Your Environment
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: