[3.12] gh-120572: add missing parentheses in TypeIs documentation (GH-120573) (#120578)

This commit is contained in:
Nyuan Zhang 2024-06-16 14:50:27 +08:00 committed by GitHub
parent a0e7e41d58
commit f774d49b7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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