mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
bpo-39481: Make weakref and WeakSet generic (GH-19497)
This commit is contained in:
parent
cecf049673
commit
8ef875028a
3 changed files with 12 additions and 1 deletions
|
|
@ -362,6 +362,12 @@ static PyMemberDef weakref_members[] = {
|
|||
{NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
static PyMethodDef weakref_methods[] = {
|
||||
{"__class_getitem__", (PyCFunction)Py_GenericAlias,
|
||||
METH_O|METH_CLASS, PyDoc_STR("See PEP 585")},
|
||||
{NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
PyTypeObject
|
||||
_PyWeakref_RefType = {
|
||||
PyVarObject_HEAD_INIT(&PyType_Type, 0)
|
||||
|
|
@ -392,7 +398,7 @@ _PyWeakref_RefType = {
|
|||
0, /*tp_weaklistoffset*/
|
||||
0, /*tp_iter*/
|
||||
0, /*tp_iternext*/
|
||||
0, /*tp_methods*/
|
||||
weakref_methods, /*tp_methods*/
|
||||
weakref_members, /*tp_members*/
|
||||
0, /*tp_getset*/
|
||||
0, /*tp_base*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue