From: Nyuan Zhang Date: Sun, 16 Jun 2024 06:50:27 +0000 (+0800) Subject: [3.12] gh-120572: add missing parentheses in TypeIs documentation (GH-120573) (#120578) X-Git-Tag: v3.12.5~211 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f774d49b7a955662771135b5b88112cc786b42ee;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-120572: add missing parentheses in TypeIs documentation (GH-120573) (#120578) --- 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