FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Rephrase typing.assert_never docs by hauntsaninja · Pull Request #92061 · python/cpython · GitHub

/ cpython Public
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 2 additions & 2 deletions Doc/library/typing.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2337,7 +2337,7 @@ Functions and decorators

.. function:: assert_never(arg, /)

Assert to the type checker that a line of code is unreachable.
Ask a static type checker to confirm that a line of code is unreachable.

Example::

Expand All @@ -2358,7 +2358,7 @@ Functions and decorators
reachable, it will emit an error. For example, if the type annotation
for ``arg`` was instead ``int | str | float``, the type checker would
emit an error pointing out that ``unreachable`` is of type :class:`float`.
For a call to ``assert_never`` to succeed, the inferred type of
For a call to ``assert_never`` to pass type checking, the inferred type of
the argument passed in must be the bottom type, :data:`Never`, and nothing
else.

Expand Down

Back | FazBrowse Home | New Git URL