Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f774d49

Browse files
[3.12] gh-120572: add missing parentheses in TypeIs documentation (GH-120573) (#120578)
1 parent a0e7e41 commit f774d49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/library/typing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,8 +1394,8 @@ These can be used as types in annotations. They all support subscription using
13941394
print("Not a list of strings!")
13951395

13961396
If ``is_str_list`` is a class or instance method, then the type in
1397-
``TypeGuard`` maps to the type of the second parameter after ``cls`` or
1398-
``self``.
1397+
``TypeGuard`` maps to the type of the second parameter (after ``cls`` or
1398+
``self``).
13991399

14001400
In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``,
14011401
means that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from

0 commit comments

Comments
 (0)