Skip to content

sys.version_info is assumed to be (3, 5), even on Python 3.6 #2836

@5j9

Description

@5j9

Running Python 3.6, I noticed that any type hints that I add to the stub files with a if sys.version_info >= (3, 6): condition, don't have any effect.

After investigating this a little, it seems that semanal.py uses the PYTHON3_VERSION value inside default.py module as sys.version_info and it is currently hardcoded as 3.5.

Using mypy.ini config file with the following content fixes the issue:

[mypy]
    python_version = 3.6

But still the default behaviour is confusing and probably should be changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions