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

Fix Unknown and Any variables being coloured as Unbound #235

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

ValdezFOmar
Copy link
Contributor

Fixes #180

Copy link
Contributor

github-actions bot commented Apr 1, 2024

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@ValdezFOmar
Copy link
Contributor Author

ValdezFOmar commented Apr 1, 2024

I noticed that Any is being coloured as a variable instead of a type and that is already an open issue (#150). Looking at how is defined in typeshed makes sense that it would be coloured this way, but is really odd that they decided to do this in the first place.

@DetachHead
Copy link
Owner

I noticed that Any is being coloured as a variable instead of a type and that is already an open issue (#150). Looking at how is defined in typeshed makes sense that it would be coloured this way, but is really odd that they decided to do is in the first place.

yeah that's really weird. @KotlinIsland any idea what's up with that? should we just change it to _SpecialForm to match the others?

@KotlinIsland
Copy link
Collaborator

KotlinIsland commented Apr 1, 2024

Yeah, it's bizarre how they wrote typing.pyi, we could try changing it to _SpecialForm and see if it breaks anything.

Surprisingly, it looks like it's already special-cased to some extent:

from typing import Any

reveal_type(Any)  # Type of "Any" is "Any"

It will actually depend on the version of python, as it's not a _SpecialForm any more, it's a _AnyMeta now.

@KotlinIsland
Copy link
Collaborator

@DetachHead DetachHead merged commit 3c860e2 into DetachHead:main Apr 1, 2024
4 checks passed
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.

variables with "Unknown" & Any types are coloured as unbound
3 participants