@@ -298,9 +298,9 @@ visualize this analogy in the following table:
298298 * - ``B `` is :term: `equivalent ` to ``A ``
299299 - ``B `` is :term: `consistent ` with ``A ``
300300
301- We can also define an **equivalence ** relation on gradual types: the gradual
302- types ``A `` and ``B `` are equivalent (that is, the same gradual type, not
303- merely consistent with one another) if and only if all materializations of
301+ We can also define an **equivalence ** relation on gradual types: the gradual
302+ types ``A `` and ``B `` are equivalent (that is, the same gradual type, not
303+ merely consistent with one another) if and only if all materializations of
304304``A `` are also materializations of ``B ``, and all materializations of ``B ``
305305are also materializations of ``A ``.
306306
@@ -368,10 +368,16 @@ can likewise be materialized to ``T1 | T2``. Thus, the gradual types ``S1`` and
368368
369369If ``B `` is a subtype of ``A ``, ``B | A `` is equivalent to ``A ``.
370370
371- This rule applies only to subtypes, not assignable-to. The union ``T | Any `` is
371+ This rule applies only to subtypes, not assignable-to. For any type ``T ``
372+ other than the top and bottom types (``object `` and ``Never ``), the union ``T | Any `` is
372373not reducible to a simpler form. It represents an unknown static type with
373374lower bound ``T ``. That is, it represents an unknown set of objects which may
374375be as large as ``object ``, or as small as ``T ``, but no smaller.
376+ The exceptions are ``object `` and ``Never ``. The union ``object | Any `` is equivalent to
377+ ``object ``, because ``object `` is a type containing all values and therefore the ``Any ``
378+ cannot add any values. Similarly, ``Never | Any `` is equivalent to ``Any ``, because
379+ ``Never `` is a type containing no values, so that including it in a union cannot add any
380+ values to the type.
375381
376382Equivalent gradual types can, however, be simplified from unions; e.g.
377383``list[Any] | list[Any] `` is equivalent to ``list[Any] ``. Similarly, the union
0 commit comments