[Python-checkins] Rephrase typing.assert_never docs (#92061)

JelleZijlstra webhook-mailer at python.org
Fri Apr 29 23:13:25 EDT 2022


https://github.com/python/cpython/commit/2f7952c35b8fb2487cb9749081d2c0c604d41107
commit: 2f7952c35b8fb2487cb9749081d2c0c604d41107
branch: main
author: Shantanu <12621235+hauntsaninja at users.noreply.github.com>
committer: JelleZijlstra <jelle.zijlstra at gmail.com>
date: 2022-04-29T21:13:21-06:00
summary:

Rephrase typing.assert_never docs (#92061)

This change is similar to that in #32069

files:
M Doc/library/typing.rst

diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index 0f31b90b7610e..426cbf12b8c92 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -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::
 
@@ -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.
 



More information about the Python-checkins mailing list