Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6a1c87d

Browse files
committed
Add the necessary field for weak reference support to the function and
method types.
1 parent 4131830 commit 6a1c87d

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

Include/classobject.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ typedef struct {
3232
PyObject *im_func; /* The callable object implementing the method */
3333
PyObject *im_self; /* The instance it is bound to, or NULL */
3434
PyObject *im_class; /* The class that defined the method */
35+
PyObject *im_weakreflist; /* List of weak references */
3536
} PyMethodObject;
3637

3738
extern DL_IMPORT(PyTypeObject) PyClass_Type, PyInstance_Type, PyMethod_Type;

Include/funcobject.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ typedef struct {
1616
PyObject *func_doc;
1717
PyObject *func_name;
1818
PyObject *func_dict;
19+
PyObject *func_weakreflist;
1920
} PyFunctionObject;
2021

2122
extern DL_IMPORT(PyTypeObject) PyFunction_Type;

0 commit comments

Comments
 (0)