Skip to content

Commit 1fa5959

Browse files
gh-120572: add missing parentheses in TypeIs documentation (#120573)
1 parent 08d09cf commit 1fa5959

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/library/typing.rst

+2-2
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)