首页 > 解决方案 > 使用 Python2 和 Python3 为项目设置 vscode MyPy

问题描述

我有一个基于 vscode linux 的项目,主要是Python2.7。该项目早在 Python3 出现势头之前就开始了。

在 vscode 设置中,我必须指定代码用于 python2。

"python.linting.mypyArgs": [ "--py2" ],

现在,我必须添加一些用Python3编写的新代码/模块/包。

我可以将 vscode mypy 配置为对某些文件/目录使用 Python3 linting,对其他文件/目录使用 Python2 linting 吗?如果是这样,怎么做?

标签: vscode-settingsmypyvscode-python

解决方案


推荐阅读