mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
gh-110209: Add __class_getitem__ for generator and coroutine (#110212)
This commit is contained in:
parent
b4bdf83cc6
commit
e7dafdc224
3 changed files with 5 additions and 1 deletions
|
|
@ -799,6 +799,7 @@ static PyMethodDef gen_methods[] = {
|
|||
{"throw",_PyCFunction_CAST(gen_throw), METH_FASTCALL, throw_doc},
|
||||
{"close",(PyCFunction)gen_close, METH_NOARGS, close_doc},
|
||||
{"__sizeof__", (PyCFunction)gen_sizeof, METH_NOARGS, sizeof__doc__},
|
||||
{"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
|
||||
{NULL, NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
|
|
@ -1151,6 +1152,7 @@ static PyMethodDef coro_methods[] = {
|
|||
{"throw",_PyCFunction_CAST(gen_throw), METH_FASTCALL, coro_throw_doc},
|
||||
{"close",(PyCFunction)gen_close, METH_NOARGS, coro_close_doc},
|
||||
{"__sizeof__", (PyCFunction)gen_sizeof, METH_NOARGS, sizeof__doc__},
|
||||
{"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
|
||||
{NULL, NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue