You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Doc/library/stdtypes.rst
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5346,6 +5346,15 @@ creation::
5346
5346
>>> type(l)
5347
5347
<class 'list'>
5348
5348
5349
+
5350
+
Additionally, instances of ``GenericAlias`` are not considered to be classes at runtime, even though they behave like classes (e.g. they can be instantiated)::
5351
+
5352
+
>>> import inspect
5353
+
>>> inspect.isclass(list[int])
5354
+
False
5355
+
5356
+
This is true for :ref:`user-defined generics <user-defined-generics>` also.
5357
+
5349
5358
Calling :func:`repr` or :func:`str` on a generic shows the parameterized type::
0 commit comments