Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Aug 13, 2024
1 parent bab532e commit de81026
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/spec/overload.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ should report an error::
def func(x: str, /) -> str: ...
@overload
def func(x: int) -> int: ...

# This implementation is inconsistent with the second overload
# because it does not accept a keyword argument ``x`` and the
# the overload's return type ``int`` is not assignable to the
Expand All @@ -169,7 +169,7 @@ should report an error::
Overlapping overloads
^^^^^^^^^^^^^^^^^^^^^

If two overloads can accept the same set of arguments but have
If two overloads can accept the same set of arguments but have
different return types, the overloads are said to "partially overlap".
This condition is indicative of a programming error and should
be reported by type checkers::
Expand All @@ -184,7 +184,7 @@ be reported by type checkers::
def func(x: int) -> str: ...

If all arguments accepted by an overload are also always accepted by
an earlier overload, the two overloads are said to "fully overlap".
an earlier overload, the two overloads are said to "fully overlap".
In this case, the latter overload will never be used. This condition
is indicative of a programming error and should be reported by type
checkers::
Expand Down Expand Up @@ -355,7 +355,7 @@ Example 3::
def example3(x: int, y: int) -> tuple[int, int]: ...
@overload
def example3(*args: int) -> tuple[int, ...]: ...

def test():
# Step 1 eliminates second overload. Step 4 and
# step 5 do not apply. Step 6 picks the first
Expand Down

0 comments on commit de81026

Please sign in to comment.