Skip to content

Commit

Permalink
[3.12] gh-120572: add missing parentheses in TypeIs documentation (GH…
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueGlassBlock authored Jun 16, 2024
1 parent a0e7e41 commit f774d49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1394,8 +1394,8 @@ These can be used as types in annotations. They all support subscription using
print("Not a list of strings!")

If ``is_str_list`` is a class or instance method, then the type in
``TypeGuard`` maps to the type of the second parameter after ``cls`` or
``self``.
``TypeGuard`` maps to the type of the second parameter (after ``cls`` or
``self``).

In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``,
means that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from
Expand Down

0 comments on commit f774d49

Please sign in to comment.