mirror of
https://github.com/python/cpython
synced 2024-10-15 00:28:04 +00:00
[3.12] gh-120572: add missing parentheses in TypeIs documentation (GH-120573) (#120578)
This commit is contained in:
parent
a0e7e41d58
commit
f774d49b7a
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue