From f774d49b7a955662771135b5b88112cc786b42ee Mon Sep 17 00:00:00 2001 From: Nyuan Zhang Date: Sun, 16 Jun 2024 14:50:27 +0800 Subject: [PATCH] [3.12] gh-120572: add missing parentheses in TypeIs documentation (GH-120573) (#120578) --- Doc/library/typing.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 1a5c21d3c943..3d75573c1337 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -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 -- 2.47.3