]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Rephrase typing.assert_never docs (#92061)
authorShantanu <12621235+hauntsaninja@users.noreply.github.com>
Sat, 30 Apr 2022 03:13:21 +0000 (21:13 -0600)
committerGitHub <noreply@github.com>
Sat, 30 Apr 2022 03:13:21 +0000 (21:13 -0600)
This change is similar to that in #32069

Doc/library/typing.rst

index 0f31b90b7610eea779be5f2ff252b0807d9a1cd5..426cbf12b8c926264868016be4de8e397a16a054 100644 (file)
@@ -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.