Skip to content

Commit

Permalink
Update docs/spec/callables.rst
Browse files Browse the repository at this point in the history
Co-authored-by: David Salvisberg <dave@daverball.com>
  • Loading branch information
erictraut and Daverball committed Apr 21, 2024
1 parent c6ff728 commit 4c80592
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/spec/callables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,10 @@ to mean "any conceivable set of parameters that could be compatible"::
type CallbackWithStr[**P] = Callable[Concatenate[str, P], str]

def func(cb: Callable[[int, str], str]) -> None:
f1: CallbackWithInt[...] = cb # OK
f2: CallbackWithStr[...] = cb # Error
f1: Callable[Concatenate[int, ...], str] = cb # OK
f2: Callable[Concatenate[str, ...], str] = cb # Error
f3: CallbackWithInt[...] = cb # OK
f4: CallbackWithStr[...] = cb # Error

.. _`callback-protocols`:

Expand Down

0 comments on commit 4c80592

Please sign in to comment.