KEMBAR78
Support max version marker of stdlib typeshed modules by srittau · Pull Request #10402 · python/mypy · GitHub
Skip to content

Conversation

srittau
Copy link
Contributor

@srittau srittau commented May 2, 2021

This implements python/typeshed#5304.

Test Plan

I verified this manually with the following test script:

import datetime

And running mypy using Python 3.9 in the following situations:

VERSIONS file mypy parameters expected result
2.7 none passes
2.7-3.10 none passes
2.7-3.9 none passes
2.7-3.8 none cannot find stub
2.7 --python-version=3.8 passes
2.7-3.9 --python-version=3.8 passes
2.7-3.8 --python-version=3.8 passes
2.7-3.7 --python-version=3.8 cannot find stub

I did the same with the following test script (as functools has a separate Python 2 stub):

import functools

@srittau
Copy link
Contributor Author

srittau commented May 3, 2021

Cc @JelleZijlstra I have slightly updated the code to support the open-ended 2.7- format.

@JelleZijlstra JelleZijlstra merged commit 8bc1115 into python:master May 4, 2021
@srittau srittau deleted the typeshed-max-version branch May 4, 2021 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants