Skip to content

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

Merged
JelleZijlstra merged 4 commits intopython:mainfrom
JelleZijlstra:improvenever
Apr 25, 2022
Merged

gh-90633: Improve error and docs for typing.assert_never#91720
JelleZijlstra merged 4 commits intopython:mainfrom
JelleZijlstra:improvenever

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.

Thanks Alex!

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@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.

4 participants