Skip to content

Commit 0febb80

Browse files
added to docs
1 parent 3e12030 commit 0febb80

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Doc/reference/compound_stmts.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,11 @@ The same keyword should not be repeated in class patterns.
10981098
The following is the logical flow for matching a class pattern against a
10991099
subject value:
11001100

1101+
#. If ``name_or_attr`` is a union type, apply the subsequent steps in order to
1102+
each of its members, returning the first successful match or raising the first
1103+
encountered exception.
1104+
This mirrors the behavior of :func:`isinstance` with union types.
1105+
11011106
#. If ``name_or_attr`` is not an instance of the builtin :class:`type` , raise
11021107
:exc:`TypeError`.
11031108

0 commit comments

Comments
 (0)