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

Add support for Never #12153

Merged
merged 1 commit into from
Feb 9, 2022
Merged

Add support for Never #12153

merged 1 commit into from
Feb 9, 2022

Conversation

JelleZijlstra
Copy link
Member

This will exist in 3.11 and in the next release of typing-extensions. See python/cpython#30842 and python/typing#1060. The implementation simply introduces a new synonym for NoReturn.

I didn't do anything with typing.assert_never because it doesn't have any special semantics: it should work just based on the annotations.

I also added explicit support for typing_extensions.NoReturn. I think that one doesn't matter in practice because the typeshed stub for typing-extensions just re-exports typing.NoReturn. Still, it's nice for completeness.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2022

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! 👏

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.

2 participants