From 410f07a551423eff742d452e1a795b5227cb8ed6 Mon Sep 17 00:00:00 2001 From: BlueGlassBlock Date: Sun, 16 Jun 2024 14:03:10 +0800 Subject: [PATCH] [3.12] gh-120572: add missing parentheses in TypeIs documentation (GH-120573) --- 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 1a5c21d3c94304..3d75573c133720 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