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
This currently produces a bunch of false-positive errors:
$ python -m pyanalyze -c '''from typing import TypeVar
T = TypeVar("T", None, str)
def f(source: T) -> T:
if source is None:
return source
if source.startswith("x"):
return source[1:]
return source
'''
None has no attribute 'startswith' (code: undefined_attribute)
In <code> at line 6
3: def f(source: T) -> T:
4: if source is None:
5: return source
6: if source.startswith("x"):
^
7: return source[1:]
8: return source
<uninitialized> is not callable (code: not_callable)
In <code> at line 7
4: if source is None:
5: return source
6: if source.startswith("x"):
7: return source[1:]
^
8: return source
The text was updated successfully, but these errors were encountered:
This currently produces a bunch of false-positive errors:
The text was updated successfully, but these errors were encountered: