Skip to content

Commit 86f7688

Browse files
committed
Clarify that tuple should be accepted as an argument to type
Closes #2145 This spec change reconciles the typing spec and the conformance testsuite. `tuple` is an object of the `type` class, so it should be accepted as a value of `type`.
1 parent 211b0cb commit 86f7688

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/spec/special-types.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,9 @@ concrete class object, e.g. in the above example::
188188
``type[T]`` where ``T`` is a type variable is allowed when annotating the
189189
first argument of a class method (see the relevant section).
190190

191-
Any other special constructs like ``tuple`` or ``Callable`` are not allowed
192-
as an argument to ``type``.
191+
Any other special constructs like ``Callable`` are not allowed
192+
as an argument to ``type``,
193+
but ``tuple`` is allowed as an argument to ``type``.
193194

194195
There are some concerns with this feature: for example when
195196
``new_user()`` calls ``user_class()`` this implies that all subclasses

0 commit comments

Comments
 (0)