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
The problem is that quite often people use this behavior of in (and ==) in working code, depending on the fact that e.g. None or some other value is not in a given list (or not equal to a given value). So "fixing" this would cause a lot of pain for people who have painstakingly annotated legacy codebases. (Like my employer.)
Given the following code:
mypy --strict --py2 example.py
does not complain that I'm looking for strings in a list of ints.I don't think there are duplicate issues, but
in
is a tricky thing to search for. This comment in #4071 is possibly relevant, talking about narrowing.The text was updated successfully, but these errors were encountered: