Closed
Description
I ’m not sure if it ’s mypy or typeshed issue.
I found an issue about this, here is a short example using Assignment expressions
, it will throw an error:
❯ cat a.py
import re
if (m := re.search(".", "foo")):
print(m[0])
❯ mypy a.py
a.py:4: error: Value of type "Optional[Match[str]]" is not indexable
print(m[0])
^
Found 1 error in 1 file (checked 1 source file)
Metadata
Metadata
Assignees
Labels
No labels