mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
[3.12] gh-119011: type.__type_params__
now return an empty tuple (GH-119296) (#119681)
(cherry picked from commit 6b240c2308
)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
parent
08636c1a7d
commit
7f06cd335e
4 changed files with 19 additions and 1 deletions
|
@ -1506,8 +1506,11 @@ type_set_annotations(PyTypeObject *type, PyObject *value, void *context)
|
|||
static PyObject *
|
||||
type_get_type_params(PyTypeObject *type, void *context)
|
||||
{
|
||||
PyObject *params = PyDict_GetItemWithError(lookup_tp_dict(type), &_Py_ID(__type_params__));
|
||||
if (type == &PyType_Type) {
|
||||
return PyTuple_New(0);
|
||||
}
|
||||
|
||||
PyObject *params = PyDict_GetItemWithError(lookup_tp_dict(type), &_Py_ID(__type_params__));
|
||||
if (params) {
|
||||
return Py_NewRef(params);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue