Skip to content

Consider supporting sys.version_info.major (and .minor) #4661

Closed

Description

@gvanrossum

It turns out there's a nicer notation than sys.version_info[0] -- sys.version_info.major. Consider supporting this too, as well as .minor. This is supported by Python 2.7, 3.1 and higher, so all Python versions that mypy supports.

A minor PEP 484 update would be required here: https://www.python.org/dev/peps/pep-0484/#version-and-platform-checking

Note that we'd need buy-in from PyCharm and Google's pytype as well before we can start using this in stubs (where it's most useful).

Activity

  1. hauntsaninja commented on Aug 5, 2021

    @hauntsaninja
    Collaborator

    Not worth the effort of coordinating all the other type checkers.

  2. emmatyping commented on Aug 5, 2021

    @emmatyping
    Member

    I think we could support this, but the issue should be in the typing repo I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions