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

Skip to content

Commit d4e1d09

Browse files
[3.13] gh-120572: add missing parentheses in TypeIs documentation (GH-120573) (#120575)
gh-120572: add missing parentheses in TypeIs documentation (GH-120573) (cherry picked from commit 1fa5959) Co-authored-by: Nyuan Zhang <[email protected]>
1 parent a19bb26 commit d4e1d09

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
@@ -1454,8 +1454,8 @@ These can be used as types in annotations. They all support subscription using
14541454
to write such functions in a type-safe manner.
14551455

14561456
If a ``TypeIs`` function is a class or instance method, then the type in
1457-
``TypeIs`` maps to the type of the second parameter after ``cls`` or
1458-
``self``.
1457+
``TypeIs`` maps to the type of the second parameter (after ``cls`` or
1458+
``self``).
14591459

14601460
In short, the form ``def foo(arg: TypeA) -> TypeIs[TypeB]: ...``,
14611461
means that if ``foo(arg)`` returns ``True``, then ``arg`` is an instance

0 commit comments

Comments
 (0)