From: Nyuan Zhang Date: Sun, 16 Jun 2024 05:36:10 +0000 (+0800) Subject: gh-120572: add missing parentheses in TypeIs documentation (#120573) X-Git-Tag: v3.14.0a1~1479 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1fa595963ed512b055d2a4faddef5a9e544288ac;p=thirdparty%2FPython%2Fcpython.git gh-120572: add missing parentheses in TypeIs documentation (#120573) --- diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 94de64fcf835..bf0ff9bd3485 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -1454,8 +1454,8 @@ These can be used as types in annotations. They all support subscription using to write such functions in a type-safe manner. If a ``TypeIs`` function is a class or instance method, then the type in - ``TypeIs`` maps to the type of the second parameter after ``cls`` or - ``self``. + ``TypeIs`` maps to the type of the second parameter (after ``cls`` or + ``self``). In short, the form ``def foo(arg: TypeA) -> TypeIs[TypeB]: ...``, means that if ``foo(arg)`` returns ``True``, then ``arg`` is an instance