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

mypy fails for a simple Any type alias` #12421

Closed
srittau opened this issue Mar 22, 2022 · 3 comments · Fixed by #12431
Closed

mypy fails for a simple Any type alias` #12421

srittau opened this issue Mar 22, 2022 · 3 comments · Fixed by #12431
Labels
affects-typeshed Anything that blocks a typeshed change bug mypy got something wrong topic-type-alias TypeAlias and other type alias issues

Comments

@srittau
Copy link
Contributor

srittau commented Mar 22, 2022

I can't reproduce this locally, but please have a look at the CI failures of python/typeshed#7535. The change is a simple type alias Incomplete = Any. The TypeAlias is optional, mypy fails with or without it. CI runs mypy 0.941 with all Python versions.

@srittau srittau added the bug mypy got something wrong label Mar 22, 2022
@AlexWaygood
Copy link
Member

#12134 (by @sobolevn) contains a fix for this bug. I think it might be good to excise that fix into a standalone PR.

@JelleZijlstra JelleZijlstra added the topic-type-alias TypeAlias and other type alias issues label Mar 22, 2022
@JukkaL
Copy link
Collaborator

JukkaL commented Mar 23, 2022

I'll extract the Any fix from #12134 to a standalone PR. (cc @sobolevn)

@JukkaL
Copy link
Collaborator

JukkaL commented Mar 23, 2022

Extracted the fix to #12429. The issue seems specific to typeshed (and possibly typeshed tests, in particular), and only reproduces for me if the files are passed to mypy in a specific order in the typeshed mypy test. I was able to reproduce it on macOS occasionally by randomizing the order of files passed to mypy.

JukkaL added a commit that referenced this issue Mar 23, 2022
Various things can go wrong if the order of modules in the builtins
SCC that also includes typing, _typeshed and others is adjusted.

Hopefully fixes #12422. May also fix #12421.
JukkaL added a commit that referenced this issue Mar 23, 2022
Various things can go wrong if the order of modules in the builtins
SCC that also includes typing, _typeshed and others is adjusted.

Hopefully fixes #12422. May also fix #12421.
@AlexWaygood AlexWaygood added the affects-typeshed Anything that blocks a typeshed change label Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-typeshed Anything that blocks a typeshed change bug mypy got something wrong topic-type-alias TypeAlias and other type alias issues
Projects
None yet
4 participants