Skip to content

Commit d414386

Browse files
Apply suggestions from code review
Co-authored-by: Alex Waygood <[email protected]>
1 parent 67c1675 commit d414386

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

docs/spec/overload.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ that it is consistent with all of its associated overload signatures.
159159
The implementation should accept all potential sets of arguments
160160
that are accepted by the overloads and should produce all potential return
161161
types produced by the overloads. In typing terms, this means the input
162-
signature of the implementation should be :term:<assignable> to the input
162+
signature of the implementation should be :term:`assignable` to the input
163163
signatures of all overloads, and the return type of all overloads should be
164164
assignable to the return type of the implementation.
165165

@@ -174,7 +174,7 @@ should report an error::
174174
# This implementation is inconsistent with the second overload
175175
# because it does not accept a keyword argument ``x`` and the
176176
# the overload's return type ``int`` is not assignable to the
177-
implementation's return type ``str``.
177+
# implementation's return type ``str``.
178178
def func(x: int | str, /) -> str:
179179
return str(x)
180180

@@ -244,7 +244,7 @@ When a type checker evaluates the call of an overloaded function, it
244244
attempts to "match" the supplied arguments with one or more overloads.
245245
This section describes the algorithm that type checkers should use
246246
for overload matching. This algorithm should be applied even in the
247-
presence of :ref:<overlapping overloads>.
247+
presence of :ref:`overlapping overloads`.
248248

249249
Only the overloads (the ``@overload``-decorated signatures) should be
250250
considered for matching purposes. The implementation, if provided,
@@ -331,7 +331,7 @@ because there are possible materializations of ``list[Any]`` (for example,
331331
Once this filtering process is applied for all arguments, examine the return
332332
types of the remaining overloads. If these return types include type variables,
333333
they should be replaced with their solved types. If the resulting return types
334-
for all remaining overloads are :term:<equivalent>, proceed to step 6.
334+
for all remaining overloads are :term:`equivalent`, proceed to step 6.
335335

336336
If the return types are not equivalent, overload matching is ambiguous. In
337337
this case, assume a return type of ``Any`` and stop.
@@ -437,21 +437,21 @@ a union of a finite set of subtypes should be expanded into its constituent
437437
subtypes. This includes the following cases.
438438

439439
1. Explicit unions: Each subtype of the union should be considered as a
440-
separate argument type. For example, the type ``int | str`` should be expanded
441-
into ``int`` and ``str``.
440+
separate argument type. For example, the type ``int | str`` should be expanded
441+
into ``int`` and ``str``.
442442

443443
2. ``bool`` should be expanded into ``Literal[True]`` and ``Literal[False]``.
444444

445445
3. ``Enum`` types (other than those that derive from ``enum.Flag``) should
446-
be expanded into their literal members.
446+
be expanded into their literal members.
447447

448448
4. ``type[A | B]`` should be expanded into ``type[A]`` and ``type[B]``.
449449

450450
5. Tuples of known length that contain expandable types should be expanded
451-
into all possible combinations of their element types. For example, the type
452-
``tuple[int | str, bool]`` should be expanded into ``(int, Literal[True])``,
453-
``(int, Literal[False])``, ``(str, Literal[True])``, and
454-
``(str, Literal[False])``.
451+
into all possible combinations of their element types. For example, the type
452+
``tuple[int | str, bool]`` should be expanded into ``(int, Literal[True])``,
453+
``(int, Literal[False])``, ``(str, Literal[True])``, and
454+
``(str, Literal[False])``.
455455

456456
The above list may not be exhaustive, and additional cases may be added in
457457
the future as the type system evolves.

0 commit comments

Comments
 (0)