diff options
author | Fred Drake <fdrake@acm.org> | 2001-11-17 06:30:20 +0000 |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-11-17 06:30:20 +0000 |
commit | 777b4a7230362628d501230d1bd7612a23442b92 (patch) | |
tree | 1e4ac9e44625b323b4fcdc782dfbd841146f3fe1 /Demo/embed | |
parent | 7b819f2254b11c7babf25697b085f621e1e04e3e (diff) | |
download | cpython-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.c | 5 |
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 */ }; |