File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,8 +117,8 @@ to a variable of any type ``T``::
117117 v1: int = x # OK — Never is a subtype of int
118118 v2: str = x # OK — Never is a subtype of str
119119
120- No type other than ``Never `` itself (and :ref: ` Any < any >`) is a subtype of
121- `` Never ``. In particular, ``object `` is *not * a subtype of ``Never ``::
120+ No type other than ``Never `` itself is a subtype of `` Never ``. In
121+ particular, ``object `` is *not * a subtype of ``Never ``::
122122
123123 def g(x: object) -> Never:
124124 return x # Error — object is not assignable to Never
@@ -162,9 +162,10 @@ apply: ``Container[Never]`` is only assignable to ``Container[Never]``::
162162``type[Never] ``
163163^^^^^^^^^^^^^^^^^
164164
165- ``type[Never] `` represents the class object for a type that has no instances.
166- In practice this type is rarely useful directly, but it is the correct result
167- of narrowing a ``type[T] `` variable to an impossible branch.
165+ ``type[Never] `` is a subtype of ``type[T] `` for every type ``T ``, just as
166+ ``Never `` is a subtype of every type ``T ``. In practice a variable receives
167+ this type only in provably unreachable code — for example, when narrowing a
168+ ``type[int] | type[str] `` through all possible branches.
168169
169170.. _`numeric-promotions` :
170171
You can’t perform that action at this time.
0 commit comments