Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5832,7 +5832,7 @@ The builtin functions :func:`isinstance` and :func:`issubclass` do not accept
>>> isinstance([1, 2], list[str])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: isinstance() argument 2 cannot be a parameterized generic
TypeError: isinstance() argument 2 cannot be an argumentized generic type

The Python runtime does not enforce :term:`type annotations <annotation>`.
This extends to generic types and their type parameters. When creating
Expand Down Expand Up @@ -6087,7 +6087,7 @@ enables cleaner type hinting syntax compared to subscripting :class:`typing.Unio
>>> isinstance([1], int | list[int])
Traceback (most recent call last):
...
TypeError: isinstance() argument 2 cannot be a parameterized generic
TypeError: isinstance() argument 2 cannot be an argumentized generic type

The user-exposed type for the union object can be accessed from
:class:`typing.Union` and used for :func:`isinstance` checks::
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"parameterized generic" should be "argumentized generic type"
4 changes: 2 additions & 2 deletions Objects/genericaliasobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -753,15 +753,15 @@ static PyObject *
ga_instancecheck(PyObject *self, PyObject *Py_UNUSED(ignored))
{
PyErr_SetString(PyExc_TypeError,
"isinstance() argument 2 cannot be a parameterized generic");
"isinstance() argument 2 cannot be an argumentized generic type");
return NULL;
}

static PyObject *
ga_subclasscheck(PyObject *self, PyObject *Py_UNUSED(ignored))
{
PyErr_SetString(PyExc_TypeError,
"issubclass() argument 2 cannot be a parameterized generic");
"issubclass() argument 2 cannot be an argumentized generic type");
return NULL;
}

Expand Down
Loading