We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
type[]
1 parent f816a64 commit d93fba9Copy full SHA for d93fba9
docs/spec/special-types.rst
@@ -175,7 +175,10 @@ Note that it is legal to use a union of classes as the parameter for
175
user = new_user(user_class)
176
...
177
178
-However the actual argument passed in at runtime must still be a
+``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
182
concrete class object, e.g. in the above example::
183
184
new_non_team_user(ProUser) # OK
0 commit comments