cpython/Modules/xxsubtype.c

#include "Python.h"

#include <stddef.h>               // offsetof()
#include <time.h>                 // clock()


PyDoc_STRVAR(xxsubtype__doc__,
"xxsubtype is an example module showing how to subtype builtin types from C.\n"
"test_descr.py in the standard test suite requires it in order to complete.\n"
"If you don't care about the examples, and don't intend to run the Python\n"
"test suite, you can recompile Python without Modules/xxsubtype.c.");

/* We link this module statically for convenience.  If compiled as a shared
   library instead, some compilers don't allow addresses of Python objects
   defined in other libraries to be used in static initializers here.  The
   DEFERRED_ADDRESS macro is used to tag the slots where such addresses
   appear; the module init function must fill in the tagged slots at runtime.
   The argument is for documentation -- the macro ignores it.
*/
#define DEFERRED_ADDRESS(ADDR)

/* spamlist -- a list subtype */

spamlistobject;

static PyObject *
spamlist_getstate(spamlistobject *self, PyObject *args)
{}

static PyObject *
spamlist_setstate(spamlistobject *self, PyObject *args)
{}

static PyObject *
spamlist_specialmeth(PyObject *self, PyObject *args, PyObject *kw)
{}

static PyMethodDef spamlist_methods[] =;

static int
spamlist_init(spamlistobject *self, PyObject *args, PyObject *kwds)
{}

static PyObject *
spamlist_state_get(spamlistobject *self, void *Py_UNUSED(ignored))
{}

static PyGetSetDef spamlist_getsets[] =;

static PyTypeObject spamlist_type =;

/* spamdict -- a dict subtype */

spamdictobject;

static PyObject *
spamdict_getstate(spamdictobject *self, PyObject *args)
{}

static PyObject *
spamdict_setstate(spamdictobject *self, PyObject *args)
{}

static PyMethodDef spamdict_methods[] =;

static int
spamdict_init(spamdictobject *self, PyObject *args, PyObject *kwds)
{}

static PyMemberDef spamdict_members[] =;

static PyTypeObject spamdict_type =;

static PyObject *
spam_bench(PyObject *self, PyObject *args)
{}

static PyMethodDef xxsubtype_functions[] =;

static int
xxsubtype_exec(PyObject* m)
{}

static struct PyModuleDef_Slot xxsubtype_slots[] =;

static struct PyModuleDef xxsubtypemodule =;


PyMODINIT_FUNC
PyInit_xxsubtype(void)
{}