Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up.
  • Loading branch information
serhiy-storchaka committed Nov 21, 2025
commit b38b8b8b5095b8dc4217d996c6faf0f22d38e699
13 changes: 8 additions & 5 deletions Include/descrobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,14 @@ struct PyMemberDef {
#define _Py_T_NONE 20 // Deprecated. Value is always None.

/* Flags */
#define Py_READONLY 1
#define Py_AUDIT_READ 2 // Added in 3.10, harmless no-op before that
#define _Py_WRITE_RESTRICTED 4 // Deprecated, no-op. Do not reuse the value.
#define Py_RELATIVE_OFFSET 8
#define _Py_AFTER_ITEMS 16
#define Py_READONLY (1 << 0)
#define Py_AUDIT_READ (1 << 1) // Added in 3.10, harmless no-op before that
#define _Py_WRITE_RESTRICTED (1 << 2) // Deprecated, no-op. Do not reuse the value.
#define Py_RELATIVE_OFFSET (1 << 3)

#ifndef Py_LIMITED_API
# define _Py_AFTER_ITEMS (1 << 4) // For internal use.
#endif

PyAPI_FUNC(PyObject *) PyMember_GetOne(const char *, PyMemberDef *);
PyAPI_FUNC(int) PyMember_SetOne(char *, PyMemberDef *, PyObject *);
Expand Down
2 changes: 2 additions & 0 deletions Include/internal/pycore_descrobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ typedef propertyobject _PyPropertyObject;

extern PyTypeObject _PyMethodWrapper_Type;

extern void *_PyMember_GetOffset(PyObject *, PyMemberDef *);

#ifdef __cplusplus
}
#endif
Expand Down
3 changes: 1 addition & 2 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "pycore_abstract.h" // _PySequence_IterSearch()
#include "pycore_call.h" // _PyObject_VectorcallTstate()
#include "pycore_code.h" // CO_FAST_FREE
#include "pycore_descrobject.h" // _PyMember_GetOffset()
#include "pycore_dict.h" // _PyDict_KeysSize()
#include "pycore_function.h" // _PyFunction_GetVersionForCurrentState()
#include "pycore_interpframe.h" // _PyInterpreterFrame
Expand Down Expand Up @@ -2568,8 +2569,6 @@ _PyHeapType_GET_MEMBERS(PyHeapTypeObject* type)
return PyObject_GetItemData((PyObject *)type);
}

void *_PyMember_GetOffset(PyObject *obj, PyMemberDef *l);

static int
traverse_slots(PyTypeObject *type, PyObject *self, visitproc visit, void *arg)
{
Expand Down
1 change: 1 addition & 0 deletions Python/structmember.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "Python.h"
#include "pycore_abstract.h" // _PyNumber_Index()
#include "pycore_descrobject.h" // _PyMember_GetOffset()
#include "pycore_long.h" // _PyLong_IsNegative()
#include "pycore_object.h" // _Py_TryIncrefCompare(), FT_ATOMIC_*()
#include "pycore_critical_section.h"
Expand Down
Loading