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

Define mypy_extensions.i16 in stubs #15562

Merged
merged 1 commit into from Jul 1, 2023
Merged

Define mypy_extensions.i16 in stubs #15562

merged 1 commit into from Jul 1, 2023

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Jul 1, 2023

I forgot to add this when I added mypyc support for the i16 native integer type.

The mypy_extensions stubs are maintained here instead of typeshed.

This is a copy of the stubs for i32, with references to i32 replaced with i16.

I forgot to add this when I added mypyc support for the i16 native
integer type.

The mypy_extensions stubs are maintained here instead of typeshed.
@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2023

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

@JukkaL JukkaL merged commit 3730899 into master Jul 1, 2023
20 checks passed
@JukkaL JukkaL deleted the stubs-i16 branch July 1, 2023 16:35
@JelleZijlstra
Copy link
Member

There are also mypy-extensions stubs in typeshed, should we drop those?

https://github.com/python/typeshed/tree/main/stubs/mypy-extensions

@AlexWaygood
Copy link
Member

There are also mypy-extensions stubs in typeshed, should we drop those?

https://github.com/python/typeshed/tree/main/stubs/mypy-extensions

I was wondering this. The only reason I can see for them still being useful would be if somebody wanted to use some mypy-specific features, so started using mypy_extensions in their code, but still wanted basic typechecking to work well with other type checkers such as pyright. Feels a bit far-fetched, but maybe plausible?

The mypy_extensions stubs in typeshed are definitely in an unusual situation now, whatever the case.

@JukkaL
Copy link
Collaborator Author

JukkaL commented Jul 3, 2023

The mypy-extensions stubs in typeshed are still useful for users of IDEs that perform on-the-fly type checking. In particular, they contain type aliases that allow using native integer types like i16 without generating errors, though mypy will perform additional checks not supported by IDEs. However, it would be much better to ship these "fallback" stubs with mypy-extensions.

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.

None yet

3 participants