summaryrefslogtreecommitdiff
path: root/Demo/embed
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-11-17 06:30:20 +0000
committerFred Drake <fdrake@acm.org>2001-11-17 06:30:20 +0000
commit777b4a7230362628d501230d1bd7612a23442b92 (patch)
tree1e4ac9e44625b323b4fcdc782dfbd841146f3fe1 /Demo/embed
parent7b819f2254b11c7babf25697b085f621e1e04e3e (diff)
downloadcpython-777b4a7230362628d501230d1bd7612a23442b92.tar.gz
Update to use more modern calling conventions; also avoid a magic number
in the function table. Add a docstring for the function as well, since examples should show good form.
Diffstat (limited to 'Demo/embed')
-rw-r--r--Demo/embed/demo.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Demo/embed/demo.c b/Demo/embed/demo.c
index 581365f36e..6005f1396b 100644
--- a/Demo/embed/demo.c
+++ b/Demo/embed/demo.c
@@ -48,13 +48,12 @@ main(int argc, char **argv)
static PyObject *
xyzzy_foo(PyObject *self, PyObject* args)
{
- if (!PyArg_ParseTuple(args, ""))
- return NULL;
return PyInt_FromLong(42L);
}
static PyMethodDef xyzzy_methods[] = {
- {"foo", xyzzy_foo, 1},
+ {"foo", xyzzy_foo, METH_NOARGS,
+ "Return the meaning of everything."},
{NULL, NULL} /* sentinel */
};