Closed
Description
from typing import Optional, List
def is_not_none(lst):
# type: (Optional[List[str]]) -> bool
return lst is not None
def get_first_element(lst):
# type: (Optional[List[str]]) -> str
if is_not_none(lst):
return lst[0]
return 'not found'
mypy invocation: mypy --py2 .
Expected output:
Success: no issues found in 1 source file
Actual output
ex.py:12: error: Value of type "Optional[List[str]]" is not indexable
Found 1 error in 1 file (checked 1 source file)
Metadata
Metadata
Assignees
Labels
No labels