diff options
author | Shantanu <12621235+hauntsaninja@users.noreply.github.com> | 2022-04-30 03:13:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-30 03:13:21 (GMT) |
commit | 2f7952c35b8fb2487cb9749081d2c0c604d41107 (patch) | |
tree | dbea3db7dc84b40838b430dedeb2be3b5e9a38fb /Doc | |
parent | d0064a1e72c6709ede3f2ac1db109c9208d42eb0 (diff) | |
download | cpython-2f7952c35b8fb2487cb9749081d2c0c604d41107.zip cpython-2f7952c35b8fb2487cb9749081d2c0c604d41107.tar.gz cpython-2f7952c35b8fb2487cb9749081d2c0c604d41107.tar.bz2 |
Rephrase typing.assert_never docs (#92061)
This change is similar to that in #32069
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/typing.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 0f31b90..426cbf1 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. |