Skip to content

Recent change to concurrent/futures/_base.pyi broke a bunch of code #6033

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
erictraut opened this issue Sep 14, 2021 · 4 comments · Fixed by #6034
Closed

Recent change to concurrent/futures/_base.pyi broke a bunch of code #6033

erictraut opened this issue Sep 14, 2021 · 4 comments · Fixed by #6034

Comments

@erictraut
Copy link
Contributor

I just pulled the latest typeshed stubs for inclusion in the next release of pylance, and I noticed that a recent change to concurrent/futures/_base.pyi triggered a bunch of our internal smoke tests.

The problem is that it now imports the type Set from collections.abc rather than from typing. But collections.abc.Set is aliased to typing.AbstractSet which is not type compatible with typing.Set. Was this change intended? What is the implication of reverting it?

I've temporarily backed out this change from the copy of typeshed that we ship with pylance because I think it's going to be pretty disruptive.

@JelleZijlstra
Copy link
Member

cc @HunterAP23 who wrote the PR.

It doesn't look like this change was intentional; probably it just came with switching Iterable and Mapping to being imported from collections.abc. I'd be OK with reverting this part of the PR, or just using set[] directly.

At some point it may be helpful to set up a pyright-primer complementing mypy-primer to find issues with pyright in our CI.

@erictraut
Copy link
Contributor Author

Thanks @JelleZijlstra.

This issue wasn't specific to pyright. Mypy would have reported the same issue if it were run on this code. We use some internal Microsoft Python code bases as a smoke test for pyright, and that's where I discovered the problem. It also triggered an error in one of pyright's unit tests, which happened to use the affected module.

@srittau
Copy link
Collaborator

srittau commented Sep 14, 2021

This was just an oversight. #6034.

@HunterAP23
Copy link
Contributor

It was an oversight on my part - thank you to both srittau and akuli for correcting it.

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 a pull request may close this issue.

4 participants