AnyStr parameter + sys.version_info
check in function causes mypy to not realize True is bool
#18210
Labels
sys.version_info
check in function causes mypy to not realize True is bool
#18210
Bug Report
Consider the following code:
Running
mypy --warn-return-any
on this code produces the following erroneous error:If the type of the
s
parameter is changed tostr
, or the parameter is removed entirely, then the error goes away. The error also goes away if thesys.version_info
check is something that succeeds on the current Python.Expected Behavior
mypy
should not have reported any errors.Your Environment
--warn-return-any
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: