Skip to content

Mypy plugin doesn't honor the python 2.7 option #21

@abhishekrb19

Description

@abhishekrb19

I installed the mypy-plugin.jar on PyCharm 2018.1, and I am trying to run mypy on some python 2.7 code with the 2.7 interpreter and PATH suffix configured correctly.

dmypy start -- --python-version=2.7; dmypy check test_api.py
or
dmypy start -- --py2; dmypy check test_api.py

I see this:

test_api:95: error: Missing parentheses in call to 'print'. Did you mean print(out, err)?

This appears to be a python3 error.

Appears that the'py2'option is not being honored. I know this because running the same from command line using the option gives me different warnings (specific to python 2.7).

E.g., mypy --py2 --ignore-missing-imports test_api.py

test_api.py:16: error: Argument 1 to "join" has incompatible type "Optional[str]"; expected "str"

Has anyone tried this? It is easily reproducible. Am I missing something here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions