型の不整合から危険なコードを検出してくれる

settings.jsonに以下を追加

"python.linting.mypyEnabled": true

参考

mypyの基礎とvscodeへの導入方