Type checking not working as expected?

已回答

This line of code:

s: List[int] = [1, 's', 2]

raises an error with mypy:

error: List item 1 has incompatible type "str"; expected "int"

But no warning on pycharm editor. Is that normal?

Environment: Pycharm Professional 2020.3 on windows 10

 

0

Hi,

I filed a bug to our issue tracker https://youtrack.jetbrains.com/issue/PY-46009, please feel free to vote for it and leave comments.

0

请先登录再写评论。