Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gvanrossum opened this issue Mar 2, 2018 · 2 comments
Closed

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

gvanrossum opened this issue Mar 2, 2018 · 2 comments
Labels

Comments

@gvanrossum
Copy link
Member

gvanrossum commented Mar 2, 2018

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).

@hauntsaninja
Copy link
Collaborator

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

@emmatyping
Copy link
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
Labels
Projects
None yet
Development

No branches or pull requests

3 participants