Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5346,6 +5346,15 @@ creation::
>>> type(l)
<class 'list'>


Additionally, instances of ``GenericAlias`` are not considered to be classes at runtime, even though they behave like classes (e.g. they can be instantiated)::

>>> import inspect
>>> inspect.isclass(list[int])
False

This is true for :ref:`user-defined generics <user-defined-generics>` also.

Calling :func:`repr` or :func:`str` on a generic shows the parameterized type::

>>> repr(list[int])
Expand Down
Loading