summaryrefslogtreecommitdiffstats
path: root/Demo
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-11-17 06:30:20 (GMT)
committerFred Drake <fdrake@acm.org>2001-11-17 06:30:20 (GMT)
commit3176b08874941c2be97b7ab5b1efbfae886eac01 (patch)
tree6b5d417ca051271ff9bfd46f085b5a4e2a4f3e4f /Demo
parente012e35460e6c33b7c3a042de83c451dba98e430 (diff)
downloadcpython-3176b08874941c2be97b7ab5b1efbfae886eac01.zip
cpython-3176b08874941c2be97b7ab5b1efbfae886eac01.tar.gz
cpython-3176b08874941c2be97b7ab5b1efbfae886eac01.tar.bz2
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')
-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 581365f..6005f13 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 */
};