Skip to content
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

Use of Protocol requires Python 3.7 or newer error from typing_extensions #2343

Closed
bbatliner opened this issue Feb 7, 2022 · 2 comments
Closed
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@bbatliner
Copy link

Environment data

  • Language Server version: 2022.2.0
  • OS and version: any x64
  • Python version (and distribution if applicable, e.g. Anaconda): 3.6
  • python.analysis.indexing: null
  • python.analysis.typeCheckingMode: off

Expected behaviour

from typing_extensions import Protocol

class Foo(Protocol):
    ...

This would have no errors. This worked in Pylance version 2022.1.5 (released 1 wk ago)

Actual behaviour

Error: "Use of Protocol requires Python 3.7 or newer"

This seems to have broken in Pylance version 2022.2.0 (released 3 days ago). I would expect to get this error if I import from typing, but typing_extensions implements this for older versions of Python and Pylance was able to distinguish these until this latest release.

@github-actions github-actions bot added the triage label Feb 7, 2022
@erictraut
Copy link
Contributor

This was a regression introduced by a recent change in the typeshed stubs. A fix will be included in this week's pylance. For details refer to this issue in the pyright repo.

@erictraut erictraut added bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version and removed triage labels Feb 7, 2022
@bbatliner
Copy link
Author

Awesome, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

2 participants