Setup vscode MyPy for project with both Python2 and Python3

159 Views Asked by At

I have a vscode linux based project that is mainly Python2.7. The project started well before Python3 had momentum.

In vscode settings I have to following to specify the code is for python2.

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

Now, I have to add in some new code/modules/packages that are written in Python3.

Can I configure vscode mypy to use Python3 linting for some files/directories and Python2 linting for other files/directories ? If so, how?

0

There are 0 best solutions below