gh-120572: add missing parentheses in TypeIs documentation (#120573)

This commit is contained in:
Nyuan Zhang 2024-06-16 13:36:10 +08:00 committed by GitHub
parent 08d09cf5ba
commit 1fa595963e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -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. to write such functions in a type-safe manner.
If a ``TypeIs`` function is a class or instance method, then the type in 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 ``TypeIs`` maps to the type of the second parameter (after ``cls`` or
``self``. ``self``).
In short, the form ``def foo(arg: TypeA) -> TypeIs[TypeB]: ...``, In short, the form ``def foo(arg: TypeA) -> TypeIs[TypeB]: ...``,
means that if ``foo(arg)`` returns ``True``, then ``arg`` is an instance means that if ``foo(arg)`` returns ``True``, then ``arg`` is an instance