Skip to content

Commit d93fba9

Browse files
Specify that type[] distributes over unions (#1841)
1 parent f816a64 commit d93fba9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/spec/special-types.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,10 @@ Note that it is legal to use a union of classes as the parameter for
175175
user = new_user(user_class)
176176
...
177177

178-
However the actual argument passed in at runtime must still be a
178+
``type[]`` distributes over unions:
179+
``type[A | B]`` is :term:`equivalent` to ``type[A] | type[B]``.
180+
181+
However, the actual argument passed in at runtime must still be a
179182
concrete class object, e.g. in the above example::
180183

181184
new_non_team_user(ProUser) # OK

0 commit comments

Comments
 (0)