view PC/example_nt/example.c @ 50784:65c1938fb9ff legacy-trunk

#1162154: inspect.getmembers() now skips attributes that raise AttributeError, e.g. a __slots__ attribute which has not been set.
author Amaury Forgeot d'Arc <amauryfa@gmail.com>
date Tue, 13 Jan 2009 23:39:22 +0000
parents a5298f371be7
children bd0e361bd642
line wrap: on
line source

#include "Python.h"

static PyObject *
ex_foo(PyObject *self, PyObject *args)
{
	printf("Hello, world\n");
	Py_INCREF(Py_None);
	return Py_None;
}

static PyMethodDef example_methods[] = {
	{"foo", ex_foo, METH_VARARGS, "foo() doc string"},
	{NULL, NULL}
};

PyMODINIT_FUNC
initexample(void)
{
	Py_InitModule("example", example_methods);
}