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

gh-90633: Improve error and docs for typing.assert_never #91720

Merged
merged 4 commits into from
Apr 25, 2022

Conversation

JelleZijlstra
Copy link
Member

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Perhaps it might be nice to include a one-sentence explanation of how the type checker determines unreachability here (by narrowing the type such that the only satisfiable type is the empty bottom type, Never). That might clear up some of the user confusion that we had in the linked issue.

@JelleZijlstra
Copy link
Member Author

@AlexWaygood good point, I expanded the docs.

Doc/library/typing.rst Outdated Show resolved Hide resolved
Doc/library/typing.rst Show resolved Hide resolved
Thanks Alex!

Co-authored-by: Alex Waygood <[email protected]>
@JelleZijlstra JelleZijlstra merged commit 93d2801 into python:main Apr 25, 2022
@JelleZijlstra JelleZijlstra deleted the improvenever branch April 25, 2022 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants