mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
Issue #17643: Add __callback__ attribute to weakref.ref.
This commit is contained in:
parent
548677bb8c
commit
556e94b8fe
4 changed files with 44 additions and 3 deletions
|
@ -338,6 +338,11 @@ weakref___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
|||
}
|
||||
|
||||
|
||||
static PyMemberDef weakref_members[] = {
|
||||
{"__callback__", T_OBJECT, offsetof(PyWeakReference, wr_callback), READONLY},
|
||||
{NULL} /* Sentinel */
|
||||
};
|
||||
|
||||
PyTypeObject
|
||||
_PyWeakref_RefType = {
|
||||
PyVarObject_HEAD_INIT(&PyType_Type, 0)
|
||||
|
@ -369,7 +374,7 @@ _PyWeakref_RefType = {
|
|||
0, /*tp_iter*/
|
||||
0, /*tp_iternext*/
|
||||
0, /*tp_methods*/
|
||||
0, /*tp_members*/
|
||||
weakref_members, /*tp_members*/
|
||||
0, /*tp_getset*/
|
||||
0, /*tp_base*/
|
||||
0, /*tp_dict*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue