cpython/Modules/_testcapi/structmember.c

#include "parts.h"
#include <stddef.h>   // for offsetof()


// This defines two classes that contain all the simple member types, one
// using "new" Py_-prefixed API, and the other using "old" <structmember.h>.
// They should behave identically in Python.

all_structmembers;

test_structmembers;


static struct PyMemberDef test_members_newapi[] =;

static PyObject *
test_structmembers_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{}

static PyType_Slot test_structmembers_slots[] =;

static PyType_Spec test_structmembers_spec =;

#include <structmember.h>

static struct PyMemberDef test_members[] =;


static void
test_structmembers_free(PyObject *ob)
{}

/* Designated initializers would work too, but this does test the *old* API */
static PyTypeObject test_structmembersType_OldAPI=;


int
_PyTestCapi_Init_Structmember(PyObject *m)
{}