Example:
deff(a: Optional[str]) ->str:
ifa=='<string>': returna[1:-1]
else: return''
With --strict-optional, this produces an error:
error: Value of type None is not indexable
It would be nice if mypy understood that a is a string if this == returns True.
Example:
With
--strict-optional, this produces an error:It would be nice if mypy understood that a is a string if this == returns True.