Index: Include/intobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/intobject.h,v retrieving revision 2.31 diff -w -u -r2.31 intobject.h --- Include/intobject.h 28 Oct 2004 16:31:58 -0000 2.31 +++ Include/intobject.h 24 Jan 2005 23:36:06 -0000 @@ -43,6 +43,13 @@ PyAPI_FUNC(long) PyInt_GetMax(void); +/* XXX This is a temporary API that is necessary since strings and lists + can only hold sequences up to INT_MAX. If sizeof(int) == sizeof(long), + this API is the same as PyInt_AsLong(). It only matters when + sizeof(int) != sizeof(long). +*/ +PyAPI_FUNC(int) _PyInt_AsInt(PyObject *); + /* Macro, trading safety for speed */ #define PyInt_AS_LONG(op) (((PyIntObject *)(op))->ob_ival) Index: Include/methodobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/methodobject.h,v retrieving revision 2.28 diff -w -u -r2.28 methodobject.h --- Include/methodobject.h 28 Oct 2004 16:31:58 -0000 2.28 +++ Include/methodobject.h 24 Jan 2005 23:36:06 -0000 @@ -28,6 +28,10 @@ done, so use with care. */ #define PyCFunction_GET_FUNCTION(func) \ (((PyCFunctionObject *)func) -> m_ml -> ml_meth) +#define PyCFunction_GET_MIN_ARGS(func) \ + (((PyCFunctionObject *)func) -> m_ml -> ml_min_args) +#define PyCFunction_GET_MAX_ARGS(func) \ + (((PyCFunctionObject *)func) -> m_ml -> ml_max_args) #define PyCFunction_GET_SELF(func) \ (((PyCFunctionObject *)func) -> m_self) #define PyCFunction_GET_FLAGS(func) \ @@ -40,6 +44,8 @@ int ml_flags; /* Combination of METH_xxx flags, which mostly describe the args expected by the C func */ char *ml_doc; /* The __doc__ attribute, or NULL */ + int ml_min_args; /* The minimum # args to pass when METH_ARGS */ + int ml_max_args; /* The maximum # args to pass when METH_ARGS */ }; typedef struct PyMethodDef PyMethodDef; @@ -70,6 +76,13 @@ #define METH_COEXIST 0x0040 +/* METH_ARGS cannot be used with: + METH_OLDARGS, METH_VARARGS, METH_NOARGS, or METH_O + Its purpose is to expand the arguments when calling the function + rather than passing a tuple as the second argument. +*/ +#define METH_ARGS 0x0080 + typedef struct PyMethodChain { PyMethodDef *methods; /* Methods of this type */ struct PyMethodChain *link; /* NULL or base type */ Index: Objects/complexobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/complexobject.c,v retrieving revision 2.73 diff -w -u -r2.73 complexobject.c --- Objects/complexobject.c 19 Dec 2004 20:45:20 -0000 2.73 +++ Objects/complexobject.c 24 Jan 2005 23:36:06 -0000 @@ -656,8 +656,8 @@ } static PyMethodDef complex_methods[] = { - {"conjugate", (PyCFunction)complex_conjugate, METH_NOARGS}, - {"__getnewargs__", (PyCFunction)complex_getnewargs, METH_NOARGS}, + {"conjugate", (PyCFunction)complex_conjugate, METH_ARGS, NULL, 0, 0}, + {"__getnewargs__", (PyCFunction)complex_getnewargs, METH_ARGS, NULL, 0, 0}, {NULL, NULL} /* sentinel */ }; Index: Objects/descrobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/descrobject.c,v retrieving revision 2.38 diff -w -u -r2.38 descrobject.c --- Objects/descrobject.c 13 Dec 2003 11:58:56 -0000 2.38 +++ Objects/descrobject.c 24 Jan 2005 23:36:07 -0000 @@ -716,12 +716,10 @@ } static PyObject * -proxy_get(proxyobject *pp, PyObject *args) +proxy_get(proxyobject *pp, PyObject *key, PyObject *def) { - PyObject *key, *def = Py_None; - - if (!PyArg_UnpackTuple(args, "get", 1, 2, &key, &def)) - return NULL; + if (def == NULL) + def = Py_None; return PyObject_CallMethod(pp->dict, "get", "(OO)", key, def); } @@ -767,26 +765,26 @@ } static PyMethodDef proxy_methods[] = { - {"has_key", (PyCFunction)proxy_has_key, METH_O, - PyDoc_STR("D.has_key(k) -> True if D has a key k, else False")}, - {"get", (PyCFunction)proxy_get, METH_VARARGS, + {"has_key", (PyCFunction)proxy_has_key, METH_ARGS, + PyDoc_STR("D.has_key(k) -> True if D has a key k, else False"), 1, 1}, + {"get", (PyCFunction)proxy_get, METH_ARGS, PyDoc_STR("D.get(k[,d]) -> D[k] if D.has_key(k), else d." - " d defaults to None.")}, - {"keys", (PyCFunction)proxy_keys, METH_NOARGS, - PyDoc_STR("D.keys() -> list of D's keys")}, - {"values", (PyCFunction)proxy_values, METH_NOARGS, - PyDoc_STR("D.values() -> list of D's values")}, - {"items", (PyCFunction)proxy_items, METH_NOARGS, - PyDoc_STR("D.items() -> list of D's (key, value) pairs, as 2-tuples")}, - {"iterkeys", (PyCFunction)proxy_iterkeys, METH_NOARGS, - PyDoc_STR("D.iterkeys() -> an iterator over the keys of D")}, - {"itervalues",(PyCFunction)proxy_itervalues, METH_NOARGS, - PyDoc_STR("D.itervalues() -> an iterator over the values of D")}, - {"iteritems", (PyCFunction)proxy_iteritems, METH_NOARGS, + " d defaults to None."), 1, 2}, + {"keys", (PyCFunction)proxy_keys, METH_ARGS, + PyDoc_STR("D.keys() -> list of D's keys"), 0, 0}, + {"values", (PyCFunction)proxy_values, METH_ARGS, + PyDoc_STR("D.values() -> list of D's values"), 0, 0}, + {"items", (PyCFunction)proxy_items, METH_ARGS, + PyDoc_STR("D.items() -> list of D's (key, value) pairs, as 2-tuples"), 0, 0}, + {"iterkeys", (PyCFunction)proxy_iterkeys, METH_ARGS, + PyDoc_STR("D.iterkeys() -> an iterator over the keys of D"), 0, 0}, + {"itervalues",(PyCFunction)proxy_itervalues, METH_ARGS, + PyDoc_STR("D.itervalues() -> an iterator over the values of D"), 0, 0}, + {"iteritems", (PyCFunction)proxy_iteritems, METH_ARGS, PyDoc_STR("D.iteritems() ->" - " an iterator over the (key, value) items of D")}, - {"copy", (PyCFunction)proxy_copy, METH_NOARGS, - PyDoc_STR("D.copy() -> a shallow copy of D")}, + " an iterator over the (key, value) items of D"), 0, 0}, + {"copy", (PyCFunction)proxy_copy, METH_ARGS, + PyDoc_STR("D.copy() -> a shallow copy of D"), 0, 0}, {0} }; Index: Objects/dictobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/dictobject.c,v retrieving revision 2.162 diff -w -u -r2.162 dictobject.c --- Objects/dictobject.c 15 Jul 2004 15:54:04 -0000 2.162 +++ Objects/dictobject.c 24 Jan 2005 23:36:07 -0000 @@ -1535,16 +1535,11 @@ } static PyObject * -dict_get(register dictobject *mp, PyObject *args) +dict_get(register dictobject *mp, PyObject *key, PyObject *failobj) { - PyObject *key; - PyObject *failobj = Py_None; PyObject *val = NULL; long hash; - if (!PyArg_UnpackTuple(args, "get", 1, 2, &key, &failobj)) - return NULL; - if (!PyString_CheckExact(key) || (hash = ((PyStringObject *) key)->ob_shash) == -1) { hash = PyObject_Hash(key); @@ -1554,7 +1549,7 @@ val = (mp->ma_lookup)(mp, key, hash)->me_value; if (val == NULL) - val = failobj; + val = failobj ? failobj : Py_None; Py_INCREF(val); return val; } @@ -1802,40 +1797,40 @@ "D.iteritems() -> an iterator over the (key, value) items of D"); static PyMethodDef mapp_methods[] = { - {"__contains__",(PyCFunction)dict_has_key, METH_O | METH_COEXIST, - contains__doc__}, - {"__getitem__", (PyCFunction)dict_subscript, METH_O | METH_COEXIST, - getitem__doc__}, - {"has_key", (PyCFunction)dict_has_key, METH_O, - has_key__doc__}, - {"get", (PyCFunction)dict_get, METH_VARARGS, - get__doc__}, + {"__contains__",(PyCFunction)dict_has_key, METH_ARGS | METH_COEXIST, + contains__doc__, 1, 1}, + {"__getitem__", (PyCFunction)dict_subscript, METH_ARGS | METH_COEXIST, + getitem__doc__, 1, 1}, + {"has_key", (PyCFunction)dict_has_key, METH_ARGS, + has_key__doc__, 1, 1}, + {"get", (PyCFunction)dict_get, METH_ARGS, + get__doc__, 1, 2}, {"setdefault", (PyCFunction)dict_setdefault, METH_VARARGS, setdefault_doc__}, {"pop", (PyCFunction)dict_pop, METH_VARARGS, pop__doc__}, - {"popitem", (PyCFunction)dict_popitem, METH_NOARGS, - popitem__doc__}, - {"keys", (PyCFunction)dict_keys, METH_NOARGS, - keys__doc__}, - {"items", (PyCFunction)dict_items, METH_NOARGS, - items__doc__}, - {"values", (PyCFunction)dict_values, METH_NOARGS, - values__doc__}, + {"popitem", (PyCFunction)dict_popitem, METH_ARGS, + popitem__doc__, 0, 0}, + {"keys", (PyCFunction)dict_keys, METH_ARGS, + keys__doc__, 0, 0}, + {"items", (PyCFunction)dict_items, METH_ARGS, + items__doc__, 0, 0}, + {"values", (PyCFunction)dict_values, METH_ARGS, + values__doc__, 0, 0}, {"update", (PyCFunction)dict_update, METH_VARARGS | METH_KEYWORDS, update__doc__}, {"fromkeys", (PyCFunction)dict_fromkeys, METH_VARARGS | METH_CLASS, fromkeys__doc__}, - {"clear", (PyCFunction)dict_clear, METH_NOARGS, - clear__doc__}, - {"copy", (PyCFunction)dict_copy, METH_NOARGS, - copy__doc__}, - {"iterkeys", (PyCFunction)dict_iterkeys, METH_NOARGS, - iterkeys__doc__}, - {"itervalues", (PyCFunction)dict_itervalues, METH_NOARGS, - itervalues__doc__}, - {"iteritems", (PyCFunction)dict_iteritems, METH_NOARGS, - iteritems__doc__}, + {"clear", (PyCFunction)dict_clear, METH_ARGS, + clear__doc__, 0, 0}, + {"copy", (PyCFunction)dict_copy, METH_ARGS, + copy__doc__, 0, 0}, + {"iterkeys", (PyCFunction)dict_iterkeys, METH_ARGS, + iterkeys__doc__, 0, 0}, + {"itervalues", (PyCFunction)dict_itervalues, METH_ARGS, + itervalues__doc__, 0, 0}, + {"iteritems", (PyCFunction)dict_iteritems, METH_ARGS, + iteritems__doc__, 0, 0}, {NULL, NULL} /* sentinel */ }; Index: Objects/fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.193 diff -w -u -r2.193 fileobject.c --- Objects/fileobject.c 7 Nov 2004 14:15:28 -0000 2.193 +++ Objects/fileobject.c 24 Jan 2005 23:36:08 -0000 @@ -489,17 +489,14 @@ #ifdef HAVE_FTRUNCATE static PyObject * -file_truncate(PyFileObject *f, PyObject *args) +file_truncate(PyFileObject *f, PyObject *newsizeobj) { Py_off_t newsize; - PyObject *newsizeobj = NULL; Py_off_t initialpos; int ret; if (f->f_fp == NULL) return err_closed(); - if (!PyArg_UnpackTuple(args, "truncate", 0, 1, &newsizeobj)) - return NULL; /* Get current file position. If the file happens to be open for * update and the last operation was an input operation, C doesn't @@ -736,7 +733,7 @@ #endif static PyObject * -file_read(PyFileObject *f, PyObject *args) +file_read(PyFileObject *f, PyObject *arg) { long bytesrequested = -1; size_t bytesread, buffersize, chunksize; @@ -744,7 +741,8 @@ if (f->f_fp == NULL) return err_closed(); - if (!PyArg_ParseTuple(args, "|l:read", &bytesrequested)) + bytesrequested = arg ? PyInt_AsLong(arg) : -1; + if (bytesrequested == -1 && PyErr_Occurred()) return NULL; if (bytesrequested < 0) buffersize = new_buffersize(f, (size_t)0); @@ -1239,13 +1237,14 @@ /* Python method */ static PyObject * -file_readline(PyFileObject *f, PyObject *args) +file_readline(PyFileObject *f, PyObject *arg) { - int n = -1; + int n; if (f->f_fp == NULL) return err_closed(); - if (!PyArg_ParseTuple(args, "|i:readline", &n)) + n = arg ? _PyInt_AsInt(arg) : -1; + if (n == -1 && PyErr_Occurred()) return NULL; if (n == 0) return PyString_FromString(""); @@ -1255,7 +1254,7 @@ } static PyObject * -file_readlines(PyFileObject *f, PyObject *args) +file_readlines(PyFileObject *f, PyObject *arg) { long sizehint = 0; PyObject *list; @@ -1273,7 +1272,8 @@ if (f->f_fp == NULL) return err_closed(); - if (!PyArg_ParseTuple(args, "|l:readlines", &sizehint)) + sizehint = arg ? PyInt_AsLong(arg) : 0; + if (sizehint == -1 && PyErr_Occurred()) return NULL; if ((list = PyList_New(0)) == NULL) return NULL; @@ -1611,22 +1611,22 @@ "isatty() -> true or false. True if the file is connected to a tty device."); static PyMethodDef file_methods[] = { - {"readline", (PyCFunction)file_readline, METH_VARARGS, readline_doc}, - {"read", (PyCFunction)file_read, METH_VARARGS, read_doc}, + {"readline", (PyCFunction)file_readline, METH_ARGS, readline_doc, 0, 1}, + {"read", (PyCFunction)file_read, METH_ARGS, read_doc, 0, 1}, {"write", (PyCFunction)file_write, METH_VARARGS, write_doc}, - {"fileno", (PyCFunction)file_fileno, METH_NOARGS, fileno_doc}, + {"fileno", (PyCFunction)file_fileno, METH_ARGS, fileno_doc, 0, 0}, {"seek", (PyCFunction)file_seek, METH_VARARGS, seek_doc}, #ifdef HAVE_FTRUNCATE - {"truncate", (PyCFunction)file_truncate, METH_VARARGS, truncate_doc}, + {"truncate", (PyCFunction)file_truncate, METH_ARGS, truncate_doc, 0, 1}, #endif - {"tell", (PyCFunction)file_tell, METH_NOARGS, tell_doc}, + {"tell", (PyCFunction)file_tell, METH_ARGS, tell_doc, 0, 0}, {"readinto", (PyCFunction)file_readinto, METH_VARARGS, readinto_doc}, - {"readlines", (PyCFunction)file_readlines,METH_VARARGS, readlines_doc}, - {"xreadlines",(PyCFunction)file_getiter, METH_NOARGS, xreadlines_doc}, - {"writelines",(PyCFunction)file_writelines, METH_O, writelines_doc}, - {"flush", (PyCFunction)file_flush, METH_NOARGS, flush_doc}, - {"close", (PyCFunction)file_close, METH_NOARGS, close_doc}, - {"isatty", (PyCFunction)file_isatty, METH_NOARGS, isatty_doc}, + {"readlines", (PyCFunction)file_readlines,METH_ARGS, readlines_doc, 0, 1}, + {"xreadlines",(PyCFunction)file_getiter, METH_ARGS, xreadlines_doc, 0, 0}, + {"writelines",(PyCFunction)file_writelines, METH_ARGS, writelines_doc, 1, 1}, + {"flush", (PyCFunction)file_flush, METH_ARGS, flush_doc, 0, 0}, + {"close", (PyCFunction)file_close, METH_ARGS, close_doc, 0, 0}, + {"isatty", (PyCFunction)file_isatty, METH_ARGS, isatty_doc, 0, 0}, {NULL, NULL} /* sentinel */ }; Index: Objects/floatobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v retrieving revision 2.134 diff -w -u -r2.134 floatobject.c --- Objects/floatobject.c 23 Sep 2004 19:22:41 -0000 2.134 +++ Objects/floatobject.c 24 Jan 2005 23:36:08 -0000 @@ -981,7 +981,7 @@ } static PyMethodDef float_methods[] = { - {"__getnewargs__", (PyCFunction)float_getnewargs, METH_NOARGS}, + {"__getnewargs__", (PyCFunction)float_getnewargs, METH_ARGS, NULL, 0, 0}, {NULL, NULL} /* sentinel */ }; Index: Objects/intobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v retrieving revision 2.113 diff -w -u -r2.113 intobject.c --- Objects/intobject.c 25 Aug 2004 02:14:08 -0000 2.113 +++ Objects/intobject.c 24 Jan 2005 23:36:08 -0000 @@ -169,6 +169,20 @@ return val; } +int +_PyInt_AsInt(PyObject *op) +{ + long i = PyInt_AsLong(op); +#if SIZEOF_INT != SIZEOF_LONG + if (i > INT_MAX || i < INT_MIN) { + PyErr_SetString(PyExc_TypeError, + "integer value out of range"); + return -1; + } +#endif + return (int) i; +} + unsigned long PyInt_AsUnsignedLongMask(register PyObject *op) { @@ -942,7 +956,7 @@ } static PyMethodDef int_methods[] = { - {"__getnewargs__", (PyCFunction)int_getnewargs, METH_NOARGS}, + {"__getnewargs__", (PyCFunction)int_getnewargs, METH_ARGS, NULL, 0, 0}, {NULL, NULL} /* sentinel */ }; Index: Objects/listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.225 diff -w -u -r2.225 listobject.c --- Objects/listobject.c 7 Oct 2004 03:58:07 -0000 2.225 +++ Objects/listobject.c 24 Jan 2005 23:36:09 -0000 @@ -703,13 +703,12 @@ } static PyObject * -listinsert(PyListObject *self, PyObject *args) +listinsert(PyListObject *self, PyObject *indx, PyObject *v) { - int i; - PyObject *v; - if (!PyArg_ParseTuple(args, "iO:insert", &i, &v)) + int i = _PyInt_AsInt(indx); + if (i == -1 && PyErr_Occurred()) return NULL; - if (ins1(self, i, v) == 0) + if (ins1(self, (int)i, v) == 0) Py_RETURN_NONE; return NULL; } @@ -851,18 +850,15 @@ } static PyObject * -listpop(PyListObject *self, PyObject *args) +listpop(PyListObject *self, PyObject *arg) { int i = -1; - PyObject *v, *arg = NULL; + PyObject *v; int status; - if (!PyArg_UnpackTuple(args, "pop", 0, 1, &arg)) - return NULL; if (arg != NULL) { - if (PyInt_Check(arg)) - i = (int)(PyInt_AS_LONG((PyIntObject*) arg)); - else if (!PyArg_ParseTuple(args, "|i:pop", &i)) + i = _PyInt_AsInt(arg); + if (i == -1 && PyErr_Occurred()) return NULL; } if (self->ob_size == 0) { @@ -2384,7 +2380,7 @@ } static PyObject *list_iter(PyObject *seq); -static PyObject *list_reversed(PyListObject* seq, PyObject* unused); +static PyObject *list_reversed(PyListObject* seq); PyDoc_STRVAR(getitem_doc, "x.__getitem__(y) <==> x[y]"); @@ -2413,16 +2409,16 @@ static PyObject *list_subscript(PyListObject*, PyObject*); static PyMethodDef list_methods[] = { - {"__getitem__", (PyCFunction)list_subscript, METH_O|METH_COEXIST, getitem_doc}, - {"__reversed__",(PyCFunction)list_reversed, METH_NOARGS, reversed_doc}, - {"append", (PyCFunction)listappend, METH_O, append_doc}, - {"insert", (PyCFunction)listinsert, METH_VARARGS, insert_doc}, - {"extend", (PyCFunction)listextend, METH_O, extend_doc}, - {"pop", (PyCFunction)listpop, METH_VARARGS, pop_doc}, - {"remove", (PyCFunction)listremove, METH_O, remove_doc}, + {"__getitem__", (PyCFunction)list_subscript, METH_ARGS|METH_COEXIST, getitem_doc, 1, 1}, + {"__reversed__",(PyCFunction)list_reversed, METH_ARGS, reversed_doc, 0, 0}, + {"append", (PyCFunction)listappend, METH_ARGS, append_doc, 1, 1}, + {"insert", (PyCFunction)listinsert, METH_ARGS, insert_doc, 2, 2}, + {"extend", (PyCFunction)listextend, METH_ARGS, extend_doc, 1, 1}, + {"pop", (PyCFunction)listpop, METH_ARGS, pop_doc, 0, 1}, + {"remove", (PyCFunction)listremove, METH_ARGS, remove_doc, 1, 1}, {"index", (PyCFunction)listindex, METH_VARARGS, index_doc}, - {"count", (PyCFunction)listcount, METH_O, count_doc}, - {"reverse", (PyCFunction)listreverse, METH_NOARGS, reverse_doc}, + {"count", (PyCFunction)listcount, METH_ARGS, count_doc, 1, 1}, + {"reverse", (PyCFunction)listreverse, METH_ARGS, reverse_doc, 0, 0}, {"sort", (PyCFunction)listsort, METH_VARARGS | METH_KEYWORDS, sort_doc}, {NULL, NULL} /* sentinel */ }; @@ -2826,7 +2822,7 @@ PyTypeObject PyListRevIter_Type; static PyObject * -list_reversed(PyListObject *seq, PyObject *unused) +list_reversed(PyListObject *seq) { listreviterobject *it; Index: Objects/longobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v retrieving revision 1.165 diff -w -u -r1.165 longobject.c --- Objects/longobject.c 20 Sep 2004 06:14:54 -0000 1.165 +++ Objects/longobject.c 24 Jan 2005 23:36:10 -0000 @@ -2960,7 +2960,7 @@ } static PyMethodDef long_methods[] = { - {"__getnewargs__", (PyCFunction)long_getnewargs, METH_NOARGS}, + {"__getnewargs__", (PyCFunction)long_getnewargs, METH_ARGS, NULL, 0, 0}, {NULL, NULL} /* sentinel */ }; Index: Objects/methodobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/methodobject.c,v retrieving revision 2.48 diff -w -u -r2.48 methodobject.c --- Objects/methodobject.c 13 Dec 2003 11:26:11 -0000 2.48 +++ Objects/methodobject.c 24 Jan 2005 23:36:10 -0000 @@ -6,6 +6,9 @@ static PyCFunctionObject *free_list = NULL; +static PyObject* +new_fast_function(PyObject *func, PyObject *self, PyObject *arg); + PyObject * PyCFunction_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module) { @@ -97,6 +100,21 @@ return NULL; } break; + case METH_ARGS: + if (kw == NULL || PyDict_Size(kw) == 0) { + size = PyTuple_GET_SIZE(arg); + if (size >= f->m_ml->ml_min_args && + size <= f->m_ml->ml_max_args) + return new_fast_function(func, self, arg); + PyErr_Format(PyExc_TypeError, + "%.200s() takes %d-%d arguments (%d given)", + f->m_ml->ml_name, + f->m_ml->ml_min_args, + f->m_ml->ml_max_args, + size); + return NULL; + } + break; case METH_OLDARGS: /* the really old style */ if (kw == NULL || PyDict_Size(kw) == 0) { @@ -117,6 +135,68 @@ return NULL; } + +/* XXX: copied (and modified) from Python/celva.c */ + +typedef PyObject *(*PyCVarArgFunction)(PyObject*, ...); + +static PyObject* +new_fast_function(PyObject *func, PyObject *self, PyObject *args) { + PyObject *arg1 = NULL, *arg2 = NULL, *arg3 = NULL, + *arg4 = NULL, *arg5 = NULL, *arg6 = NULL, + *arg7 = NULL, *arg8 = NULL, *arg9 = NULL; + PyCVarArgFunction meth = + (PyCVarArgFunction) PyCFunction_GET_FUNCTION(func); + + /* XXX: need to determine best # of args to support */ + + /* XXX: If we know that na == max_args, this can be optimized + by having a single switch, which should save me a moderage win + */ + + /* handle varargs, note that if na > 0 each case falls through */ + switch (PyTuple_GET_SIZE(args)) { + case 0: break; + case 9: arg9 = PyTuple_GET_ITEM(args, 8); + case 8: arg8 = PyTuple_GET_ITEM(args, 7); + case 7: arg7 = PyTuple_GET_ITEM(args, 6); + case 6: arg6 = PyTuple_GET_ITEM(args, 5); + case 5: arg5 = PyTuple_GET_ITEM(args, 4); + case 4: arg4 = PyTuple_GET_ITEM(args, 3); + case 3: arg3 = PyTuple_GET_ITEM(args, 2); + case 2: arg2 = PyTuple_GET_ITEM(args, 1); + case 1: arg1 = PyTuple_GET_ITEM(args, 0); + break; + + default: + // FIXME: raise SystemError + fprintf(stderr, "FIXME: methodobject: busted METH_ARGS, na=%d\n", + PyTuple_GET_SIZE(args)); + return NULL; + } + + // FIXME: it would be nice to handle the DECREFs here + // so they are unwound and we don't need a loop + switch (PyCFunction_GET_MAX_ARGS(func)) { + case 0: return (*meth)(self); + case 1: return (*meth)(self, arg1); + case 2: return (*meth)(self, arg1, arg2); + case 3: return (*meth)(self, arg1, arg2, arg3); + case 4: return (*meth)(self, arg1, arg2, arg3, arg4); + case 5: return (*meth)(self, arg1, arg2, arg3, arg4, arg5); + case 6: return (*meth)(self, arg1, arg2, arg3, arg4, arg5, arg6); + case 7: return (*meth)(self, arg1, arg2, arg3, arg4, arg5, arg6, arg7); + case 8: return (*meth)(self, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); + case 9: return (*meth)(self, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); + + default: + // FIXME: raise SystemError + fprintf(stderr, "FIXME: methodobject: busted METH_ARGS, max args=%d\n", + PyCFunction_GET_MAX_ARGS(func)); + return NULL; + } +} + /* Methods (the standard built-in methods, that is) */ static void Index: Objects/rangeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/rangeobject.c,v retrieving revision 2.54 diff -w -u -r2.54 rangeobject.c --- Objects/rangeobject.c 3 Dec 2004 11:45:13 -0000 2.54 +++ Objects/rangeobject.c 24 Jan 2005 23:36:10 -0000 @@ -148,7 +148,7 @@ "Returns a reverse iterator."); static PyMethodDef range_methods[] = { - {"__reversed__", (PyCFunction)range_reverse, METH_NOARGS, reverse_doc}, + {"__reversed__", (PyCFunction)range_reverse, METH_ARGS, reverse_doc, 0, 0}, {NULL, NULL} /* sentinel */ }; Index: Objects/setobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/setobject.c,v retrieving revision 1.31 diff -w -u -r1.31 setobject.c --- Objects/setobject.c 9 Nov 2004 07:25:28 -0000 1.31 +++ Objects/setobject.c 24 Jan 2005 23:36:10 -0000 @@ -904,42 +904,42 @@ /* set object ********************************************************/ static PyMethodDef set_methods[] = { - {"add", (PyCFunction)set_add, METH_O, - add_doc}, - {"clear", (PyCFunction)set_clear, METH_NOARGS, - clear_doc}, - {"__contains__",(PyCFunction)set_direct_contains, METH_O | METH_COEXIST, - contains_doc}, - {"copy", (PyCFunction)set_copy, METH_NOARGS, - copy_doc}, - {"discard", (PyCFunction)set_discard, METH_O, - discard_doc}, - {"difference", (PyCFunction)set_difference, METH_O, - difference_doc}, - {"difference_update", (PyCFunction)set_difference_update, METH_O, - difference_update_doc}, - {"intersection",(PyCFunction)set_intersection, METH_O, - intersection_doc}, - {"intersection_update",(PyCFunction)set_intersection_update, METH_O, - intersection_update_doc}, - {"issubset", (PyCFunction)set_issubset, METH_O, - issubset_doc}, - {"issuperset", (PyCFunction)set_issuperset, METH_O, - issuperset_doc}, - {"pop", (PyCFunction)set_pop, METH_NOARGS, - pop_doc}, - {"__reduce__", (PyCFunction)set_reduce, METH_NOARGS, - reduce_doc}, - {"remove", (PyCFunction)set_remove, METH_O, - remove_doc}, - {"symmetric_difference",(PyCFunction)set_symmetric_difference, METH_O, - symmetric_difference_doc}, - {"symmetric_difference_update",(PyCFunction)set_symmetric_difference_update, METH_O, - symmetric_difference_update_doc}, - {"union", (PyCFunction)set_union, METH_O, - union_doc}, - {"update", (PyCFunction)set_update, METH_O, - update_doc}, + {"add", (PyCFunction)set_add, METH_ARGS, + add_doc, 1, 1}, + {"clear", (PyCFunction)set_clear, METH_ARGS, + clear_doc, 0, 0}, + {"__contains__",(PyCFunction)set_direct_contains, METH_ARGS | METH_COEXIST, + contains_doc, 1, 1}, + {"copy", (PyCFunction)set_copy, METH_ARGS, + copy_doc, 0, 0}, + {"discard", (PyCFunction)set_discard, METH_ARGS, + discard_doc, 1, 1}, + {"difference", (PyCFunction)set_difference, METH_ARGS, + difference_doc, 1, 1}, + {"difference_update", (PyCFunction)set_difference_update, METH_ARGS, + difference_update_doc, 1, 1}, + {"intersection",(PyCFunction)set_intersection, METH_ARGS, + intersection_doc, 1, 1}, + {"intersection_update",(PyCFunction)set_intersection_update, METH_ARGS, + intersection_update_doc, 1, 1}, + {"issubset", (PyCFunction)set_issubset, METH_ARGS, + issubset_doc, 1, 1}, + {"issuperset", (PyCFunction)set_issuperset, METH_ARGS, + issuperset_doc, 1, 1}, + {"pop", (PyCFunction)set_pop, METH_ARGS, + pop_doc, 0, 0}, + {"__reduce__", (PyCFunction)set_reduce, METH_ARGS, + reduce_doc, 0, 0}, + {"remove", (PyCFunction)set_remove, METH_ARGS, + remove_doc, 1, 1}, + {"symmetric_difference",(PyCFunction)set_symmetric_difference, METH_ARGS, + symmetric_difference_doc, 1, 1}, + {"symmetric_difference_update",(PyCFunction)set_symmetric_difference_update, METH_ARGS, + symmetric_difference_update_doc, 1, 1}, + {"union", (PyCFunction)set_union, METH_ARGS, + union_doc, 1, 1}, + {"update", (PyCFunction)set_update, METH_ARGS, + update_doc, 1, 1}, {NULL, NULL} /* sentinel */ }; @@ -1034,24 +1034,24 @@ static PyMethodDef frozenset_methods[] = { - {"__contains__",(PyCFunction)set_direct_contains, METH_O | METH_COEXIST, - contains_doc}, - {"copy", (PyCFunction)frozenset_copy, METH_NOARGS, - copy_doc}, - {"difference", (PyCFunction)set_difference, METH_O, - difference_doc}, - {"intersection",(PyCFunction)set_intersection, METH_O, - intersection_doc}, - {"issubset", (PyCFunction)set_issubset, METH_O, - issubset_doc}, - {"issuperset", (PyCFunction)set_issuperset, METH_O, - issuperset_doc}, - {"__reduce__", (PyCFunction)set_reduce, METH_NOARGS, - reduce_doc}, - {"symmetric_difference",(PyCFunction)set_symmetric_difference, METH_O, - symmetric_difference_doc}, - {"union", (PyCFunction)set_union, METH_O, - union_doc}, + {"__contains__",(PyCFunction)set_direct_contains, METH_ARGS | METH_COEXIST, + contains_doc, 1, 1}, + {"copy", (PyCFunction)frozenset_copy, METH_ARGS, + copy_doc, 0, 0}, + {"difference", (PyCFunction)set_difference, METH_ARGS, + difference_doc, 1, 1}, + {"intersection",(PyCFunction)set_intersection, METH_ARGS, + intersection_doc, 1, 1}, + {"issubset", (PyCFunction)set_issubset, METH_ARGS, + issubset_doc, 1, 1}, + {"issuperset", (PyCFunction)set_issuperset, METH_ARGS, + issuperset_doc, 1, 1}, + {"__reduce__", (PyCFunction)set_reduce, METH_ARGS, + reduce_doc, 0, 0}, + {"symmetric_difference",(PyCFunction)set_symmetric_difference, METH_ARGS, + symmetric_difference_doc, 1, 1}, + {"union", (PyCFunction)set_union, METH_ARGS, + union_doc, 1, 1}, {NULL, NULL} /* sentinel */ }; Index: Objects/sliceobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/sliceobject.c,v retrieving revision 2.22 diff -w -u -r2.22 sliceobject.c --- Objects/sliceobject.c 5 Sep 2003 14:27:30 -0000 2.22 +++ Objects/sliceobject.c 24 Jan 2005 23:36:10 -0000 @@ -253,7 +253,7 @@ static PyMethodDef slice_methods[] = { {"indices", (PyCFunction)slice_indices, - METH_O, slice_indices_doc}, + METH_ARGS, slice_indices_doc, 1, 1}, {NULL, NULL} }; Index: Objects/stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.226 diff -w -u -r2.226 stringobject.c --- Objects/stringobject.c 26 Oct 2004 01:52:37 -0000 2.226 +++ Objects/stringobject.c 24 Jan 2005 23:36:11 -0000 @@ -2219,7 +2219,7 @@ translation table, which must be a string of length 256."); static PyObject * -string_translate(PyStringObject *self, PyObject *args) +string_translate(PyStringObject *self, PyObject *tableobj, PyObject *delobj) { register char *input, *output; register const char *table; @@ -2229,11 +2229,6 @@ int inlen, tablen, dellen = 0; PyObject *result; int trans_table[256]; - PyObject *tableobj, *delobj = NULL; - - if (!PyArg_UnpackTuple(args, "translate", 1, 2, - &tableobj, &delobj)) - return NULL; if (PyString_Check(tableobj)) { table1 = PyString_AS_STRING(tableobj); @@ -3142,7 +3137,7 @@ otherwise."); static PyObject* -string_istitle(PyStringObject *self, PyObject *uncased) +string_istitle(PyStringObject *self) { register const unsigned char *p = (unsigned char *) PyString_AS_STRING(self); @@ -3255,20 +3250,20 @@ string_methods[] = { /* Counterparts of the obsolete stropmodule functions; except string.maketrans(). */ - {"join", (PyCFunction)string_join, METH_O, join__doc__}, + {"join", (PyCFunction)string_join, METH_ARGS, join__doc__, 1, 1}, {"split", (PyCFunction)string_split, METH_VARARGS, split__doc__}, {"rsplit", (PyCFunction)string_rsplit, METH_VARARGS, rsplit__doc__}, - {"lower", (PyCFunction)string_lower, METH_NOARGS, lower__doc__}, - {"upper", (PyCFunction)string_upper, METH_NOARGS, upper__doc__}, - {"islower", (PyCFunction)string_islower, METH_NOARGS, islower__doc__}, - {"isupper", (PyCFunction)string_isupper, METH_NOARGS, isupper__doc__}, - {"isspace", (PyCFunction)string_isspace, METH_NOARGS, isspace__doc__}, - {"isdigit", (PyCFunction)string_isdigit, METH_NOARGS, isdigit__doc__}, - {"istitle", (PyCFunction)string_istitle, METH_NOARGS, istitle__doc__}, - {"isalpha", (PyCFunction)string_isalpha, METH_NOARGS, isalpha__doc__}, - {"isalnum", (PyCFunction)string_isalnum, METH_NOARGS, isalnum__doc__}, - {"capitalize", (PyCFunction)string_capitalize, METH_NOARGS, - capitalize__doc__}, + {"lower", (PyCFunction)string_lower, METH_ARGS, lower__doc__, 0, 0}, + {"upper", (PyCFunction)string_upper, METH_ARGS, upper__doc__, 0, 0}, + {"islower", (PyCFunction)string_islower, METH_ARGS, islower__doc__, 0, 0}, + {"isupper", (PyCFunction)string_isupper, METH_ARGS, isupper__doc__, 0, 0}, + {"isspace", (PyCFunction)string_isspace, METH_ARGS, isspace__doc__, 0, 0}, + {"isdigit", (PyCFunction)string_isdigit, METH_ARGS, isdigit__doc__, 0, 0}, + {"istitle", (PyCFunction)string_istitle, METH_ARGS, istitle__doc__, 0, 0}, + {"isalpha", (PyCFunction)string_isalpha, METH_ARGS, isalpha__doc__, 0, 0}, + {"isalnum", (PyCFunction)string_isalnum, METH_ARGS, isalnum__doc__, 0, 0}, + {"capitalize", (PyCFunction)string_capitalize, METH_ARGS, + capitalize__doc__, 0, 0}, {"count", (PyCFunction)string_count, METH_VARARGS, count__doc__}, {"endswith", (PyCFunction)string_endswith, METH_VARARGS, endswith__doc__}, @@ -3282,11 +3277,11 @@ {"startswith", (PyCFunction)string_startswith, METH_VARARGS, startswith__doc__}, {"strip", (PyCFunction)string_strip, METH_VARARGS, strip__doc__}, - {"swapcase", (PyCFunction)string_swapcase, METH_NOARGS, - swapcase__doc__}, - {"translate", (PyCFunction)string_translate, METH_VARARGS, - translate__doc__}, - {"title", (PyCFunction)string_title, METH_NOARGS, title__doc__}, + {"swapcase", (PyCFunction)string_swapcase, METH_ARGS, + swapcase__doc__, 0, 0}, + {"translate", (PyCFunction)string_translate, METH_ARGS, + translate__doc__, 1, 2}, + {"title", (PyCFunction)string_title, METH_ARGS, title__doc__, 0, 0}, {"ljust", (PyCFunction)string_ljust, METH_VARARGS, ljust__doc__}, {"rjust", (PyCFunction)string_rjust, METH_VARARGS, rjust__doc__}, {"center", (PyCFunction)string_center, METH_VARARGS, center__doc__}, @@ -3297,7 +3292,7 @@ expandtabs__doc__}, {"splitlines", (PyCFunction)string_splitlines, METH_VARARGS, splitlines__doc__}, - {"__getnewargs__", (PyCFunction)string_getnewargs, METH_NOARGS}, + {"__getnewargs__", (PyCFunction)string_getnewargs, METH_ARGS, NULL, 0, 0}, {NULL, NULL} /* sentinel */ }; Index: Objects/structseq.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/structseq.c,v retrieving revision 1.12 diff -w -u -r1.12 structseq.c --- Objects/structseq.c 1 Feb 2003 02:16:37 -0000 1.12 +++ Objects/structseq.c 24 Jan 2005 23:36:11 -0000 @@ -296,7 +296,7 @@ static PyMethodDef structseq_methods[] = { {"__reduce__", (PyCFunction)structseq_reduce, - METH_NOARGS, NULL}, + METH_ARGS, NULL, 0, 0}, {NULL, NULL} }; Index: Objects/tupleobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/tupleobject.c,v retrieving revision 2.93 diff -w -u -r2.93 tupleobject.c --- Objects/tupleobject.c 10 Jun 2004 18:39:35 -0000 2.93 +++ Objects/tupleobject.c 24 Jan 2005 23:36:11 -0000 @@ -643,7 +643,7 @@ } static PyMethodDef tuple_methods[] = { - {"__getnewargs__", (PyCFunction)tuple_getnewargs, METH_NOARGS}, + {"__getnewargs__", (PyCFunction)tuple_getnewargs, METH_ARGS, NULL, 0, 0}, {NULL, NULL} /* sentinel */ }; Index: Objects/typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.264 diff -w -u -r2.264 typeobject.c --- Objects/typeobject.c 23 Sep 2004 02:39:37 -0000 2.264 +++ Objects/typeobject.c 24 Jan 2005 23:36:13 -0000 @@ -2146,10 +2146,10 @@ } static PyMethodDef type_methods[] = { - {"mro", (PyCFunction)mro_external, METH_NOARGS, - PyDoc_STR("mro() -> list\nreturn a type's method resolution order")}, - {"__subclasses__", (PyCFunction)type_subclasses, METH_NOARGS, - PyDoc_STR("__subclasses__() -> list of immediate subclasses")}, + {"mro", (PyCFunction)mro_external, METH_ARGS, + PyDoc_STR("mro() -> list\nreturn a type's method resolution order"), 0, 0}, + {"__subclasses__", (PyCFunction)type_subclasses, METH_ARGS, + PyDoc_STR("__subclasses__() -> list of immediate subclasses"), 0, 0}, {0} }; Index: Objects/unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.230 diff -w -u -r2.230 unicodeobject.c --- Objects/unicodeobject.c 22 Nov 2004 13:02:30 -0000 2.230 +++ Objects/unicodeobject.c 24 Jan 2005 23:36:14 -0000 @@ -6259,16 +6259,16 @@ {"replace", (PyCFunction) unicode_replace, METH_VARARGS, replace__doc__}, {"split", (PyCFunction) unicode_split, METH_VARARGS, split__doc__}, {"rsplit", (PyCFunction) unicode_rsplit, METH_VARARGS, rsplit__doc__}, - {"join", (PyCFunction) unicode_join, METH_O, join__doc__}, - {"capitalize", (PyCFunction) unicode_capitalize, METH_NOARGS, capitalize__doc__}, - {"title", (PyCFunction) unicode_title, METH_NOARGS, title__doc__}, + {"join", (PyCFunction) unicode_join, METH_ARGS, join__doc__, 1, 1}, + {"capitalize", (PyCFunction) unicode_capitalize, METH_ARGS, capitalize__doc__, 0, 0}, + {"title", (PyCFunction) unicode_title, METH_ARGS, title__doc__, 0, 0}, {"center", (PyCFunction) unicode_center, METH_VARARGS, center__doc__}, {"count", (PyCFunction) unicode_count, METH_VARARGS, count__doc__}, {"expandtabs", (PyCFunction) unicode_expandtabs, METH_VARARGS, expandtabs__doc__}, {"find", (PyCFunction) unicode_find, METH_VARARGS, find__doc__}, {"index", (PyCFunction) unicode_index, METH_VARARGS, index__doc__}, {"ljust", (PyCFunction) unicode_ljust, METH_VARARGS, ljust__doc__}, - {"lower", (PyCFunction) unicode_lower, METH_NOARGS, lower__doc__}, + {"lower", (PyCFunction) unicode_lower, METH_ARGS, lower__doc__, 0, 0}, {"lstrip", (PyCFunction) unicode_lstrip, METH_VARARGS, lstrip__doc__}, {"decode", (PyCFunction) unicode_decode, METH_VARARGS, decode__doc__}, /* {"maketrans", (PyCFunction) unicode_maketrans, METH_VARARGS, maketrans__doc__}, */ @@ -6278,31 +6278,31 @@ {"rstrip", (PyCFunction) unicode_rstrip, METH_VARARGS, rstrip__doc__}, {"splitlines", (PyCFunction) unicode_splitlines, METH_VARARGS, splitlines__doc__}, {"strip", (PyCFunction) unicode_strip, METH_VARARGS, strip__doc__}, - {"swapcase", (PyCFunction) unicode_swapcase, METH_NOARGS, swapcase__doc__}, - {"translate", (PyCFunction) unicode_translate, METH_O, translate__doc__}, - {"upper", (PyCFunction) unicode_upper, METH_NOARGS, upper__doc__}, + {"swapcase", (PyCFunction) unicode_swapcase, METH_ARGS, swapcase__doc__, 0, 0}, + {"translate", (PyCFunction) unicode_translate, METH_ARGS, translate__doc__, 1, 1}, + {"upper", (PyCFunction) unicode_upper, METH_ARGS, upper__doc__, 0, 0}, {"startswith", (PyCFunction) unicode_startswith, METH_VARARGS, startswith__doc__}, {"endswith", (PyCFunction) unicode_endswith, METH_VARARGS, endswith__doc__}, - {"islower", (PyCFunction) unicode_islower, METH_NOARGS, islower__doc__}, - {"isupper", (PyCFunction) unicode_isupper, METH_NOARGS, isupper__doc__}, - {"istitle", (PyCFunction) unicode_istitle, METH_NOARGS, istitle__doc__}, - {"isspace", (PyCFunction) unicode_isspace, METH_NOARGS, isspace__doc__}, - {"isdecimal", (PyCFunction) unicode_isdecimal, METH_NOARGS, isdecimal__doc__}, - {"isdigit", (PyCFunction) unicode_isdigit, METH_NOARGS, isdigit__doc__}, - {"isnumeric", (PyCFunction) unicode_isnumeric, METH_NOARGS, isnumeric__doc__}, - {"isalpha", (PyCFunction) unicode_isalpha, METH_NOARGS, isalpha__doc__}, - {"isalnum", (PyCFunction) unicode_isalnum, METH_NOARGS, isalnum__doc__}, + {"islower", (PyCFunction) unicode_islower, METH_ARGS, islower__doc__, 0, 0}, + {"isupper", (PyCFunction) unicode_isupper, METH_ARGS, isupper__doc__, 0, 0}, + {"istitle", (PyCFunction) unicode_istitle, METH_ARGS, istitle__doc__, 0, 0}, + {"isspace", (PyCFunction) unicode_isspace, METH_ARGS, isspace__doc__, 0, 0}, + {"isdecimal", (PyCFunction) unicode_isdecimal, METH_ARGS, isdecimal__doc__, 0, 0}, + {"isdigit", (PyCFunction) unicode_isdigit, METH_ARGS, isdigit__doc__, 0, 0}, + {"isnumeric", (PyCFunction) unicode_isnumeric, METH_ARGS, isnumeric__doc__, 0, 0}, + {"isalpha", (PyCFunction) unicode_isalpha, METH_ARGS, isalpha__doc__, 0, 0}, + {"isalnum", (PyCFunction) unicode_isalnum, METH_ARGS, isalnum__doc__, 0, 0}, {"zfill", (PyCFunction) unicode_zfill, METH_VARARGS, zfill__doc__}, #if 0 - {"capwords", (PyCFunction) unicode_capwords, METH_NOARGS, capwords__doc__}, + {"capwords", (PyCFunction) unicode_capwords, METH_ARGS, capwords__doc__, 0, 0}, #endif #if 0 /* This one is just used for debugging the implementation. */ - {"freelistsize", (PyCFunction) unicode_freelistsize, METH_NOARGS}, + {"freelistsize", (PyCFunction) unicode_freelistsize, METH_ARGS, NULL, 0, 0}, #endif - {"__getnewargs__", (PyCFunction)unicode_getnewargs, METH_NOARGS}, + {"__getnewargs__", (PyCFunction)unicode_getnewargs, METH_ARGS, NULL, 0, 0}, {NULL, NULL} }; Index: Python/bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.320 diff -w -u -r2.320 bltinmodule.c --- Python/bltinmodule.c 7 Dec 2004 00:25:35 -0000 2.320 +++ Python/bltinmodule.c 24 Jan 2005 23:36:14 -0000 @@ -128,15 +128,12 @@ static PyObject * -builtin_filter(PyObject *self, PyObject *args) +builtin_filter(PyObject *self, PyObject *func, PyObject *seq) { - PyObject *func, *seq, *result, *it, *arg; + PyObject *result, *it, *arg; int len; /* guess for result list size */ register int j; - if (!PyArg_UnpackTuple(args, "filter", 2, 2, &func, &seq)) - return NULL; - /* Strings and tuples return a result of the same type. */ if (PyString_Check(seq)) return filterstring(func, seq); @@ -245,12 +242,12 @@ "or string, return the same type, else return a list."); static PyObject * -builtin_chr(PyObject *self, PyObject *args) +builtin_chr(PyObject *self, PyObject *arg) { - long x; + long x = PyInt_AsLong(arg); char s[1]; - if (!PyArg_ParseTuple(args, "l:chr", &x)) + if (x == -1 && PyErr_Occurred()) return NULL; if (x < 0 || x >= 256) { PyErr_SetString(PyExc_ValueError, @@ -269,11 +266,10 @@ #ifdef Py_USING_UNICODE static PyObject * -builtin_unichr(PyObject *self, PyObject *args) +builtin_unichr(PyObject *self, PyObject *arg) { - long x; - - if (!PyArg_ParseTuple(args, "l:unichr", &x)) + long x = PyInt_AsLong(arg); + if (x == -1 && PyErr_Occurred()) return NULL; return PyUnicode_FromOrdinal(x); @@ -287,13 +283,9 @@ static PyObject * -builtin_cmp(PyObject *self, PyObject *args) +builtin_cmp(PyObject *self, PyObject *a, PyObject *b) { - PyObject *a, *b; int c; - - if (!PyArg_UnpackTuple(args, "cmp", 2, 2, &a, &b)) - return NULL; if (PyObject_Cmp(a, b, &c) < 0) return NULL; return PyInt_FromLong((long)c); @@ -306,13 +298,10 @@ static PyObject * -builtin_coerce(PyObject *self, PyObject *args) +builtin_coerce(PyObject *self, PyObject *v, PyObject *w) { - PyObject *v, *w; PyObject *res; - if (!PyArg_UnpackTuple(args, "coerce", 2, 2, &v, &w)) - return NULL; if (PyNumber_Coerce(&v, &w) < 0) return NULL; res = PyTuple_Pack(2, v, w); @@ -409,12 +398,8 @@ in addition to any features explicitly specified."); static PyObject * -builtin_dir(PyObject *self, PyObject *args) +builtin_dir(PyObject *self, PyObject *arg) { - PyObject *arg = NULL; - - if (!PyArg_UnpackTuple(args, "dir", 0, 1, &arg)) - return NULL; return PyObject_Dir(arg); } @@ -432,12 +417,8 @@ " attributes of its class's base classes."); static PyObject * -builtin_divmod(PyObject *self, PyObject *args) +builtin_divmod(PyObject *self, PyObject *v, PyObject *w) { - PyObject *v, *w; - - if (!PyArg_UnpackTuple(args, "divmod", 2, 2, &v, &w)) - return NULL; return PyNumber_Divmod(v, w); } @@ -448,15 +429,16 @@ static PyObject * -builtin_eval(PyObject *self, PyObject *args) +builtin_eval(PyObject *self, PyObject *cmd, PyObject *globals, PyObject *locals) { - PyObject *cmd, *result, *tmp = NULL; - PyObject *globals = Py_None, *locals = Py_None; + PyObject *result, *tmp = NULL; char *str; PyCompilerFlags cf; - if (!PyArg_UnpackTuple(args, "eval", 1, 3, &cmd, &globals, &locals)) - return NULL; + if (globals == NULL) + globals = Py_None; + if (locals == NULL) + locals = Py_None; if (locals != Py_None && !PyMapping_Check(locals)) { PyErr_SetString(PyExc_TypeError, "locals must be a mapping"); return NULL; @@ -631,13 +613,9 @@ static PyObject * -builtin_getattr(PyObject *self, PyObject *args) +builtin_getattr(PyObject *self, PyObject *v, PyObject *name, PyObject *dflt) { - PyObject *v, *result, *dflt = NULL; - PyObject *name; - - if (!PyArg_UnpackTuple(args, "getattr", 2, 3, &v, &name, &dflt)) - return NULL; + PyObject *result; #ifdef Py_USING_UNICODE if (PyUnicode_Check(name)) { name = _PyUnicode_AsDefaultEncodedString(name, NULL); @@ -902,14 +880,8 @@ static PyObject * -builtin_setattr(PyObject *self, PyObject *args) +builtin_setattr(PyObject *self, PyObject *v, PyObject *name, PyObject *value) { - PyObject *v; - PyObject *name; - PyObject *value; - - if (!PyArg_UnpackTuple(args, "setattr", 3, 3, &v, &name, &value)) - return NULL; if (PyObject_SetAttr(v, name, value) != 0) return NULL; Py_INCREF(Py_None); @@ -924,13 +896,8 @@ static PyObject * -builtin_delattr(PyObject *self, PyObject *args) +builtin_delattr(PyObject *self, PyObject *v, PyObject *name) { - PyObject *v; - PyObject *name; - - if (!PyArg_UnpackTuple(args, "delattr", 2, 2, &v, &name)) - return NULL; if (PyObject_SetAttr(v, name, (PyObject *)NULL) != 0) return NULL; Py_INCREF(Py_None); @@ -1055,12 +1022,8 @@ static PyObject * -builtin_iter(PyObject *self, PyObject *args) +builtin_iter(PyObject *self, PyObject *v, PyObject *w) { - PyObject *v, *w = NULL; - - if (!PyArg_UnpackTuple(args, "iter", 1, 2, &v, &w)) - return NULL; if (w == NULL) return PyObject_GetIter(v); if (!PyCallable_Check(v)) { @@ -1295,12 +1258,10 @@ static PyObject * -builtin_pow(PyObject *self, PyObject *args) +builtin_pow(PyObject *self, PyObject *v, PyObject *w, PyObject *z) { - PyObject *v, *w, *z = Py_None; - - if (!PyArg_UnpackTuple(args, "pow", 2, 3, &v, &w, &z)) - return NULL; + if (z == NULL) + z = Py_None; return PyNumber_Power(v, w, z); } @@ -1388,7 +1349,6 @@ int cmp_result; PyObject *zero = PyLong_FromLong(0); - if (zero == NULL) return NULL; @@ -1605,15 +1565,11 @@ static PyObject * -builtin_raw_input(PyObject *self, PyObject *args) +builtin_raw_input(PyObject *self, PyObject *v) { - PyObject *v = NULL; PyObject *fin = PySys_GetObject("stdin"); PyObject *fout = PySys_GetObject("stdout"); - if (!PyArg_UnpackTuple(args, "[raw_]input", 0, 1, &v)) - return NULL; - if (fin == NULL) { PyErr_SetString(PyExc_RuntimeError, "[raw_]input: lost sys.stdin"); return NULL; @@ -1689,14 +1645,11 @@ static PyObject * -builtin_reduce(PyObject *self, PyObject *args) +builtin_reduce(PyObject *self, PyObject *func, PyObject *seq, PyObject *result) { - PyObject *seq, *func, *result = NULL, *it; + PyObject *it, *args; - if (!PyArg_UnpackTuple(args, "reduce", 2, 3, &func, &seq, &result)) - return NULL; - if (result != NULL) - Py_INCREF(result); + Py_XINCREF(result); it = PyObject_GetIter(seq); if (it == NULL) { @@ -1868,13 +1821,10 @@ "sorted(iterable, cmp=None, key=None, reverse=False) --> new sorted list"); static PyObject * -builtin_vars(PyObject *self, PyObject *args) +builtin_vars(PyObject *self, PyObject *v) { - PyObject *v = NULL; PyObject *d; - if (!PyArg_UnpackTuple(args, "vars", 0, 1, &v)) - return NULL; if (v == NULL) { d = PyEval_GetLocals(); if (d == NULL) { @@ -1904,15 +1854,10 @@ static PyObject* -builtin_sum(PyObject *self, PyObject *args) +builtin_sum(PyObject *self, PyObject *seq, PyObject *result) { - PyObject *seq; - PyObject *result = NULL; PyObject *temp, *item, *iter; - if (!PyArg_UnpackTuple(args, "sum", 1, 2, &seq, &result)) - return NULL; - iter = PyObject_GetIter(seq); if (iter == NULL) return NULL; @@ -1963,16 +1908,9 @@ static PyObject * -builtin_isinstance(PyObject *self, PyObject *args) +builtin_isinstance(PyObject *self, PyObject *inst, PyObject *cls) { - PyObject *inst; - PyObject *cls; - int retval; - - if (!PyArg_UnpackTuple(args, "isinstance", 2, 2, &inst, &cls)) - return NULL; - - retval = PyObject_IsInstance(inst, cls); + int retval = PyObject_IsInstance(inst, cls); if (retval < 0) return NULL; return PyBool_FromLong(retval); @@ -1988,16 +1926,9 @@ static PyObject * -builtin_issubclass(PyObject *self, PyObject *args) +builtin_issubclass(PyObject *self, PyObject *derived, PyObject *cls) { - PyObject *derived; - PyObject *cls; - int retval; - - if (!PyArg_UnpackTuple(args, "issubclass", 2, 2, &derived, &cls)) - return NULL; - - retval = PyObject_IsSubclass(derived, cls); + int retval = PyObject_IsSubclass(derived, cls); if (retval < 0) return NULL; return PyBool_FromLong(retval); @@ -2124,51 +2055,51 @@ static PyMethodDef builtin_methods[] = { {"__import__", builtin___import__, METH_VARARGS, import_doc}, - {"abs", builtin_abs, METH_O, abs_doc}, + {"abs", builtin_abs, METH_ARGS, abs_doc, 1, 1}, {"apply", builtin_apply, METH_VARARGS, apply_doc}, - {"callable", builtin_callable, METH_O, callable_doc}, - {"chr", builtin_chr, METH_VARARGS, chr_doc}, - {"cmp", builtin_cmp, METH_VARARGS, cmp_doc}, - {"coerce", builtin_coerce, METH_VARARGS, coerce_doc}, + {"callable", builtin_callable, METH_ARGS, callable_doc, 1, 1}, + {"chr", builtin_chr, METH_ARGS, chr_doc, 1, 1}, + {"cmp", builtin_cmp, METH_ARGS, cmp_doc, 2, 2}, + {"coerce", builtin_coerce, METH_ARGS, coerce_doc, 2, 2}, {"compile", builtin_compile, METH_VARARGS, compile_doc}, - {"delattr", builtin_delattr, METH_VARARGS, delattr_doc}, - {"dir", builtin_dir, METH_VARARGS, dir_doc}, - {"divmod", builtin_divmod, METH_VARARGS, divmod_doc}, - {"eval", builtin_eval, METH_VARARGS, eval_doc}, + {"delattr", builtin_delattr, METH_ARGS, delattr_doc, 2, 2}, + {"dir", builtin_dir, METH_ARGS, dir_doc, 0, 1}, + {"divmod", builtin_divmod, METH_ARGS, divmod_doc, 2, 2}, + {"eval", builtin_eval, METH_ARGS, eval_doc, 1, 3}, {"execfile", builtin_execfile, METH_VARARGS, execfile_doc}, - {"filter", builtin_filter, METH_VARARGS, filter_doc}, - {"getattr", builtin_getattr, METH_VARARGS, getattr_doc}, - {"globals", (PyCFunction)builtin_globals, METH_NOARGS, globals_doc}, + {"filter", builtin_filter, METH_ARGS, filter_doc, 2, 2}, + {"getattr", builtin_getattr, METH_ARGS, getattr_doc, 2, 3}, + {"globals", (PyCFunction)builtin_globals, METH_ARGS, globals_doc, 0, 0}, {"hasattr", builtin_hasattr, METH_VARARGS, hasattr_doc}, - {"hash", builtin_hash, METH_O, hash_doc}, - {"hex", builtin_hex, METH_O, hex_doc}, - {"id", builtin_id, METH_O, id_doc}, - {"input", builtin_input, METH_VARARGS, input_doc}, + {"hash", builtin_hash, METH_ARGS, hash_doc, 1, 1}, + {"hex", builtin_hex, METH_ARGS, hex_doc, 1, 1}, + {"id", builtin_id, METH_ARGS, id_doc, 1, 1}, + {"input", builtin_input, METH_ARGS, input_doc, 0, 1}, {"intern", builtin_intern, METH_VARARGS, intern_doc}, - {"isinstance", builtin_isinstance, METH_VARARGS, isinstance_doc}, - {"issubclass", builtin_issubclass, METH_VARARGS, issubclass_doc}, - {"iter", builtin_iter, METH_VARARGS, iter_doc}, - {"len", builtin_len, METH_O, len_doc}, - {"locals", (PyCFunction)builtin_locals, METH_NOARGS, locals_doc}, + {"isinstance", builtin_isinstance, METH_ARGS, isinstance_doc, 2, 2}, + {"issubclass", builtin_issubclass, METH_ARGS, issubclass_doc, 2, 2}, + {"iter", builtin_iter, METH_ARGS, iter_doc, 1, 2}, + {"len", builtin_len, METH_ARGS, len_doc, 1, 1}, + {"locals", (PyCFunction)builtin_locals, METH_ARGS, locals_doc, 0, 0}, {"map", builtin_map, METH_VARARGS, map_doc}, {"max", (PyCFunction)builtin_max, METH_VARARGS | METH_KEYWORDS, max_doc}, {"min", (PyCFunction)builtin_min, METH_VARARGS | METH_KEYWORDS, min_doc}, - {"oct", builtin_oct, METH_O, oct_doc}, - {"ord", builtin_ord, METH_O, ord_doc}, - {"pow", builtin_pow, METH_VARARGS, pow_doc}, + {"oct", builtin_oct, METH_ARGS, oct_doc, 1, 1}, + {"ord", builtin_ord, METH_ARGS, ord_doc, 1, 1}, + {"pow", builtin_pow, METH_ARGS, pow_doc, 2, 3}, {"range", builtin_range, METH_VARARGS, range_doc}, - {"raw_input", builtin_raw_input, METH_VARARGS, raw_input_doc}, - {"reduce", builtin_reduce, METH_VARARGS, reduce_doc}, - {"reload", builtin_reload, METH_O, reload_doc}, - {"repr", builtin_repr, METH_O, repr_doc}, + {"raw_input", builtin_raw_input, METH_ARGS, raw_input_doc, 0, 1}, + {"reduce", builtin_reduce, METH_ARGS, reduce_doc, 2, 3}, + {"reload", builtin_reload, METH_ARGS, reload_doc, 1, 1}, + {"repr", builtin_repr, METH_ARGS, repr_doc, 1, 1}, {"round", builtin_round, METH_VARARGS, round_doc}, - {"setattr", builtin_setattr, METH_VARARGS, setattr_doc}, + {"setattr", builtin_setattr, METH_ARGS, setattr_doc, 3, 3}, {"sorted", (PyCFunction)builtin_sorted, METH_VARARGS | METH_KEYWORDS, sorted_doc}, - {"sum", builtin_sum, METH_VARARGS, sum_doc}, + {"sum", builtin_sum, METH_ARGS, sum_doc, 1, 2}, #ifdef Py_USING_UNICODE - {"unichr", builtin_unichr, METH_VARARGS, unichr_doc}, + {"unichr", builtin_unichr, METH_ARGS, unichr_doc, 1, 1}, #endif - {"vars", builtin_vars, METH_VARARGS, vars_doc}, + {"vars", builtin_vars, METH_ARGS, vars_doc, 0, 1}, {"zip", builtin_zip, METH_VARARGS, zip_doc}, {NULL, NULL}, }; Index: Python/ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.421 diff -w -u -r2.421 ceval.c --- Python/ceval.c 18 Jan 2005 15:56:11 -0000 2.421 +++ Python/ceval.c 24 Jan 2005 23:36:15 -0000 @@ -3471,6 +3471,13 @@ "%.200s() takes no arguments (%d given)", ((PyCFunctionObject *)func)->m_ml->ml_name, nargs); + else if (flags & METH_ARGS) + PyErr_Format(PyExc_TypeError, + "%.200s() takes %d-%d arguments (%d given)", + ((PyCFunctionObject *)func)->m_ml->ml_name, + ((PyCFunctionObject *)func)->m_ml->ml_min_args, + ((PyCFunctionObject *)func)->m_ml->ml_max_args, + nargs); else PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%d given)", @@ -3506,6 +3513,9 @@ } static PyObject * +new_fast_function(PyObject *meth, int na, PyObject **pp_stack); + +static PyObject * call_function(PyObject ***pp_stack, int oparg #ifdef WITH_TSC , uint64* pintr0, uint64* pintr1 @@ -3527,7 +3537,12 @@ PyThreadState *tstate = PyThreadState_GET(); PCALL(PCALL_CFUNCTION); - if (flags & (METH_NOARGS | METH_O)) { + if (flags & METH_ARGS && + (na >= PyCFunction_GET_MIN_ARGS(func) && + na <= PyCFunction_GET_MAX_ARGS(func))) { + x = new_fast_function(func, na, *pp_stack); + } + else if (flags & (METH_NOARGS | METH_O)) { PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); if (flags & METH_NOARGS && na == 0) { @@ -3584,6 +3599,89 @@ return x; } +typedef PyObject *(*PyCVarArgFunction)(PyObject*, ...); + +/* XXX: if we passed pp_stack as PyObject ***, it is faster + it looks like we have less work to do unwinding stack in + above. However, the following tests fail if it is *** + + test_array,test_bsddb,test_class,test_descr,test_gc, + test_iter,test_socket,test_sys,test_weakref +*/ + +/* XXX: does not support METH_KEYWORDS */ +static PyObject* +new_fast_function(PyObject *func, int na, PyObject **pp_stack) { + PyObject *x; + /* XXX: we only need to init arg[na] .. arg[max_args] */ + PyObject *arg1 = NULL, *arg2 = NULL, *arg3 = NULL, + *arg4 = NULL, *arg5 = NULL, *arg6 = NULL, + *arg7 = NULL, *arg8 = NULL, *arg9 = NULL; + PyThreadState *tstate = PyThreadState_GET(); + PyCVarArgFunction meth = + (PyCVarArgFunction) PyCFunction_GET_FUNCTION(func); + PyObject *self = PyCFunction_GET_SELF(func); + + /* XXX: need to determine best # of args to support */ + + /* XXX: If we know that na == max_args, this can be optimized + by having a single switch, which should be a moderage win + */ + + /* handle varargs, note that if na > 0 each case falls through */ + switch (na) { + case 0: break; + case 9: arg9 = EXT_POP(pp_stack); + case 8: arg8 = EXT_POP(pp_stack); + case 7: arg7 = EXT_POP(pp_stack); + case 6: arg6 = EXT_POP(pp_stack); + case 5: arg5 = EXT_POP(pp_stack); + case 4: arg4 = EXT_POP(pp_stack); + case 3: arg3 = EXT_POP(pp_stack); + case 2: arg2 = EXT_POP(pp_stack); + case 1: arg1 = EXT_POP(pp_stack); + break; + + default: + fprintf(stderr, "FIXME: busted METH_ARGS, na=%d\n", na); + // Should raise SystemError + return NULL; + } + + // FIXME: it would be nice to handle the DECREFs here + // so they are unwound and we don't need a loop (in the caller) + switch (PyCFunction_GET_MAX_ARGS(func)) { + case 0: C_TRACE(x = (*meth)(self)); + break; + case 1: C_TRACE(x = (*meth)(self, arg1)); + break; + case 2: C_TRACE(x = (*meth)(self, arg1, arg2)); + break; + case 3: C_TRACE(x = (*meth)(self, arg1, arg2, arg3)); + break; + case 4: C_TRACE(x = (*meth)(self, arg1, arg2, arg3, arg4)); + break; + case 5: C_TRACE(x = (*meth)(self, arg1, arg2, arg3, arg4, arg5)); + break; + case 6: C_TRACE(x = (*meth)(self, arg1, arg2, arg3, arg4, arg5, arg6)); + break; + case 7: C_TRACE(x = (*meth)(self, arg1, arg2, arg3, arg4, arg5, arg6, arg7)); + break; + case 8: C_TRACE(x = (*meth)(self, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)); + break; + case 9: C_TRACE(x = (*meth)(self, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)); + break; + + default: + // Should raise SystemError + fprintf(stderr, "FIXME: busted METH_ARGS, max args=%d\n", + PyCFunction_GET_MAX_ARGS(func)); + return NULL; + } + + return x; +} + /* The fast_function() function optimize calls for which no argument tuple is necessary; the objects are passed directly from the stack. For the simplest case -- a function that takes only positional Index: Python/codecs.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/codecs.c,v retrieving revision 2.24 diff -w -u -r2.24 codecs.c --- Python/codecs.c 8 Jul 2004 01:55:58 -0000 2.24 +++ Python/codecs.c 24 Jan 2005 23:36:16 -0000 @@ -763,7 +763,7 @@ { "strict_errors", strict_errors, - METH_O + METH_ARGS, NULL, 1, 1 } }, #ifdef Py_USING_UNICODE @@ -772,7 +772,7 @@ { "ignore_errors", ignore_errors, - METH_O + METH_ARGS, NULL, 1, 1 } }, { @@ -780,7 +780,7 @@ { "replace_errors", replace_errors, - METH_O + METH_ARGS, NULL, 1, 1 } }, { @@ -788,7 +788,7 @@ { "xmlcharrefreplace_errors", xmlcharrefreplace_errors, - METH_O + METH_ARGS, NULL, 1, 1 } }, { @@ -796,7 +796,7 @@ { "backslashreplace_errors", backslashreplace_errors, - METH_O + METH_ARGS, NULL, 1, 1 } } #endif Index: Python/exceptions.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/exceptions.c,v retrieving revision 1.49 diff -w -u -r1.49 exceptions.c --- Python/exceptions.c 25 Aug 2004 02:14:08 -0000 1.49 +++ Python/exceptions.c 24 Jan 2005 23:36:16 -0000 @@ -216,7 +216,7 @@ { PyObject *self = PyTuple_GetItem(args, 0); if (!self) { - /* Watch out for being called to early in the bootstrapping process */ + /* Watch out for being called too early in the bootstrapping process */ if (PyExc_TypeError) { PyErr_SetString(PyExc_TypeError, "unbound method must be called with instance as first argument"); @@ -311,15 +311,11 @@ static PyObject * -Exception__getitem__(PyObject *self, PyObject *args) +Exception__getitem__(PyObject *self, PyObject *self2, PyObject *index) { PyObject *out; - PyObject *index; - if (!PyArg_ParseTuple(args, "OO:__getitem__", &self, &index)) - return NULL; - - args = PyObject_GetAttrString(self, "args"); + PyObject *args = PyObject_GetAttrString(self2, "args"); if (!args) return NULL; @@ -332,7 +328,7 @@ static PyMethodDef Exception_methods[] = { /* methods for the Exception class */ - { "__getitem__", Exception__getitem__, METH_VARARGS}, + { "__getitem__", Exception__getitem__, METH_ARGS, NULL, 2, 2}, { "__str__", Exception__str__, METH_VARARGS}, { "__init__", Exception__init__, METH_VARARGS}, { NULL, NULL } @@ -1287,7 +1283,7 @@ static PyMethodDef UnicodeEncodeError_methods[] = { {"__init__", UnicodeEncodeError__init__, METH_VARARGS}, - {"__str__", UnicodeEncodeError__str__, METH_O}, + {"__str__", UnicodeEncodeError__str__, METH_ARGS, NULL, 1, 1}, {NULL, NULL} }; @@ -1364,7 +1360,7 @@ static PyMethodDef UnicodeDecodeError_methods[] = { {"__init__", UnicodeDecodeError__init__, METH_VARARGS}, - {"__str__", UnicodeDecodeError__str__, METH_O}, + {"__str__", UnicodeDecodeError__str__, METH_ARGS, NULL, 1, 1}, {NULL, NULL} }; @@ -1479,7 +1475,7 @@ static PyMethodDef UnicodeTranslateError_methods[] = { {"__init__", UnicodeTranslateError__init__, METH_VARARGS}, - {"__str__", UnicodeTranslateError__str__, METH_O}, + {"__str__", UnicodeTranslateError__str__, METH_ARGS, NULL, 1, 1}, {NULL, NULL} }; Index: Python/import.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/import.c,v retrieving revision 2.240 diff -w -u -r2.240 import.c --- Python/import.c 7 Oct 2004 06:46:25 -0000 2.240 +++ Python/import.c 24 Jan 2005 23:36:17 -0000 @@ -2764,13 +2764,13 @@ static PyMethodDef imp_methods[] = { {"find_module", imp_find_module, METH_VARARGS, doc_find_module}, - {"get_magic", imp_get_magic, METH_NOARGS, doc_get_magic}, - {"get_suffixes", imp_get_suffixes, METH_NOARGS, doc_get_suffixes}, + {"get_magic", imp_get_magic, METH_ARGS, doc_get_magic, 0, 0}, + {"get_suffixes", imp_get_suffixes, METH_ARGS, doc_get_suffixes, 0, 0}, {"load_module", imp_load_module, METH_VARARGS, doc_load_module}, {"new_module", imp_new_module, METH_VARARGS, doc_new_module}, - {"lock_held", imp_lock_held, METH_NOARGS, doc_lock_held}, - {"acquire_lock", imp_acquire_lock, METH_NOARGS, doc_acquire_lock}, - {"release_lock", imp_release_lock, METH_NOARGS, doc_release_lock}, + {"lock_held", imp_lock_held, METH_ARGS, doc_lock_held, 0, 0}, + {"acquire_lock", imp_acquire_lock, METH_ARGS, doc_acquire_lock, 0, 0}, + {"release_lock", imp_release_lock, METH_ARGS, doc_release_lock, 0, 0}, /* The rest are obsolete */ {"get_frozen_object", imp_get_frozen_object, METH_VARARGS}, {"init_builtin", imp_init_builtin, METH_VARARGS}, Index: Python/sysmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/sysmodule.c,v retrieving revision 2.127 diff -w -u -r2.127 sysmodule.c --- Python/sysmodule.c 23 Jan 2005 09:41:49 -0000 2.127 +++ Python/sysmodule.c 24 Jan 2005 23:36:17 -0000 @@ -713,44 +713,44 @@ static PyMethodDef sys_methods[] = { /* Might as well keep this in alphabetic order */ - {"callstats", (PyCFunction)PyEval_GetCallStats, METH_NOARGS, - callstats_doc}, - {"displayhook", sys_displayhook, METH_O, displayhook_doc}, - {"exc_info", sys_exc_info, METH_NOARGS, exc_info_doc}, - {"exc_clear", sys_exc_clear, METH_NOARGS, exc_clear_doc}, + {"callstats", (PyCFunction)PyEval_GetCallStats, METH_ARGS, + callstats_doc, 0, 0}, + {"displayhook", sys_displayhook, METH_ARGS, displayhook_doc, 1, 1}, + {"exc_info", sys_exc_info, METH_ARGS, exc_info_doc, 0, 0}, + {"exc_clear", sys_exc_clear, METH_ARGS, exc_clear_doc, 0, 0}, {"excepthook", sys_excepthook, METH_VARARGS, excepthook_doc}, {"exit", sys_exit, METH_VARARGS, exit_doc}, #ifdef Py_USING_UNICODE {"getdefaultencoding", (PyCFunction)sys_getdefaultencoding, - METH_NOARGS, getdefaultencoding_doc}, + METH_ARGS, getdefaultencoding_doc, 0, 0}, #endif #ifdef HAVE_DLOPEN - {"getdlopenflags", (PyCFunction)sys_getdlopenflags, METH_NOARGS, - getdlopenflags_doc}, + {"getdlopenflags", (PyCFunction)sys_getdlopenflags, METH_ARGS, + getdlopenflags_doc, 0, 0}, #endif #ifdef COUNT_ALLOCS - {"getcounts", (PyCFunction)sys_getcounts, METH_NOARGS}, + {"getcounts", (PyCFunction)sys_getcounts, METH_ARGS, NULL, 0, 0}, #endif #ifdef DYNAMIC_EXECUTION_PROFILE {"getdxp", _Py_GetDXProfile, METH_VARARGS}, #endif #ifdef Py_USING_UNICODE {"getfilesystemencoding", (PyCFunction)sys_getfilesystemencoding, - METH_NOARGS, getfilesystemencoding_doc}, + METH_ARGS, getfilesystemencoding_doc, 0, 0}, #endif #ifdef Py_TRACE_REFS {"getobjects", _Py_GetObjects, METH_VARARGS}, #endif #ifdef Py_REF_DEBUG - {"gettotalrefcount", (PyCFunction)sys_gettotalrefcount, METH_NOARGS}, + {"gettotalrefcount", (PyCFunction)sys_gettotalrefcount, METH_ARGS, NULL, 0, 0}, #endif - {"getrefcount", (PyCFunction)sys_getrefcount, METH_O, getrefcount_doc}, - {"getrecursionlimit", (PyCFunction)sys_getrecursionlimit, METH_NOARGS, - getrecursionlimit_doc}, + {"getrefcount", (PyCFunction)sys_getrefcount, METH_ARGS, getrefcount_doc, 1, 1}, + {"getrecursionlimit", (PyCFunction)sys_getrecursionlimit, METH_ARGS, + getrecursionlimit_doc, 0, 0}, {"_getframe", sys_getframe, METH_VARARGS, getframe_doc}, #ifdef MS_WINDOWS - {"getwindowsversion", (PyCFunction)sys_getwindowsversion, METH_NOARGS, - getwindowsversion_doc}, + {"getwindowsversion", (PyCFunction)sys_getwindowsversion, METH_ARGS, + getwindowsversion_doc, 0, 0}, #endif /* MS_WINDOWS */ #ifdef USE_MALLOPT {"mdebug", sys_mdebug, METH_VARARGS}, @@ -761,19 +761,19 @@ #endif {"setcheckinterval", sys_setcheckinterval, METH_VARARGS, setcheckinterval_doc}, - {"getcheckinterval", sys_getcheckinterval, METH_NOARGS, - getcheckinterval_doc}, + {"getcheckinterval", sys_getcheckinterval, METH_ARGS, + getcheckinterval_doc, 0, 0}, #ifdef HAVE_DLOPEN {"setdlopenflags", sys_setdlopenflags, METH_VARARGS, setdlopenflags_doc}, #endif - {"setprofile", sys_setprofile, METH_O, setprofile_doc}, + {"setprofile", sys_setprofile, METH_ARGS, setprofile_doc, 1, 1}, {"setrecursionlimit", sys_setrecursionlimit, METH_VARARGS, setrecursionlimit_doc}, #ifdef WITH_TSC {"settscdump", sys_settscdump, METH_VARARGS, settscdump_doc}, #endif - {"settrace", sys_settrace, METH_O, settrace_doc}, + {"settrace", sys_settrace, METH_ARGS, settrace_doc, 1, 1}, {"call_tracing", sys_call_tracing, METH_VARARGS, call_tracing_doc}, {NULL, NULL} /* sentinel */ }; Index: Modules/_csv.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_csv.c,v retrieving revision 1.36 diff -w -u -r1.36 _csv.c --- Modules/_csv.c 13 Jan 2005 11:30:53 -0000 1.36 +++ Modules/_csv.c 24 Jan 2005 23:36:17 -0000 @@ -1217,8 +1217,8 @@ } static struct PyMethodDef Writer_methods[] = { - { "writerow", (PyCFunction)csv_writerow, METH_O, csv_writerow_doc}, - { "writerows", (PyCFunction)csv_writerows, METH_O, csv_writerows_doc}, + { "writerow", (PyCFunction)csv_writerow, METH_ARGS, csv_writerow_doc, 1, 1}, + { "writerows", (PyCFunction)csv_writerows, METH_ARGS, csv_writerows_doc, 1, 1}, { NULL, NULL } }; @@ -1533,13 +1533,13 @@ { "writer", (PyCFunction)csv_writer, METH_VARARGS | METH_KEYWORDS, csv_writer_doc}, { "list_dialects", (PyCFunction)csv_list_dialects, - METH_NOARGS, csv_list_dialects_doc}, + METH_ARGS, csv_list_dialects_doc, 0, 0}, { "register_dialect", (PyCFunction)csv_register_dialect, METH_VARARGS | METH_KEYWORDS, csv_register_dialect_doc}, { "unregister_dialect", (PyCFunction)csv_unregister_dialect, - METH_O, csv_unregister_dialect_doc}, + METH_ARGS, csv_unregister_dialect_doc, 1, 1}, { "get_dialect", (PyCFunction)csv_get_dialect, - METH_O, csv_get_dialect_doc}, + METH_ARGS, csv_get_dialect_doc, 1, 1}, { "field_size_limit", (PyCFunction)csv_field_size_limit, METH_VARARGS, csv_field_size_limit_doc}, { NULL, NULL } Index: Modules/_curses_panel.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_curses_panel.c,v retrieving revision 1.13 diff -w -u -r1.13 _curses_panel.c --- Modules/_curses_panel.c 2 Aug 2002 02:27:13 -0000 1.13 +++ Modules/_curses_panel.c 24 Jan 2005 23:36:17 -0000 @@ -307,18 +307,18 @@ /* Module interface */ static PyMethodDef PyCursesPanel_Methods[] = { - {"above", (PyCFunction)PyCursesPanel_above, METH_NOARGS}, - {"below", (PyCFunction)PyCursesPanel_below, METH_NOARGS}, - {"bottom", (PyCFunction)PyCursesPanel_bottom_panel, METH_NOARGS}, - {"hidden", (PyCFunction)PyCursesPanel_panel_hidden, METH_NOARGS}, - {"hide", (PyCFunction)PyCursesPanel_hide_panel, METH_NOARGS}, + {"above", (PyCFunction)PyCursesPanel_above, METH_ARGS, NULL, 0, 0}, + {"below", (PyCFunction)PyCursesPanel_below, METH_ARGS, NULL, 0, 0}, + {"bottom", (PyCFunction)PyCursesPanel_bottom_panel, METH_ARGS, NULL, 0, 0}, + {"hidden", (PyCFunction)PyCursesPanel_panel_hidden, METH_ARGS, NULL, 0, 0}, + {"hide", (PyCFunction)PyCursesPanel_hide_panel, METH_ARGS, NULL, 0, 0}, {"move", (PyCFunction)PyCursesPanel_move_panel, METH_VARARGS}, {"replace", (PyCFunction)PyCursesPanel_replace_panel, METH_VARARGS}, - {"set_userptr", (PyCFunction)PyCursesPanel_set_panel_userptr, METH_O}, - {"show", (PyCFunction)PyCursesPanel_show_panel, METH_NOARGS}, - {"top", (PyCFunction)PyCursesPanel_top_panel, METH_NOARGS}, - {"userptr", (PyCFunction)PyCursesPanel_userptr, METH_NOARGS}, - {"window", (PyCFunction)PyCursesPanel_window, METH_NOARGS}, + {"set_userptr", (PyCFunction)PyCursesPanel_set_panel_userptr, METH_ARGS, NULL, 1, 1}, + {"show", (PyCFunction)PyCursesPanel_show_panel, METH_ARGS, NULL, 0, 0}, + {"top", (PyCFunction)PyCursesPanel_top_panel, METH_ARGS, NULL, 0, 0}, + {"userptr", (PyCFunction)PyCursesPanel_userptr, METH_ARGS, NULL, 0, 0}, + {"window", (PyCFunction)PyCursesPanel_window, METH_ARGS, NULL, 0, 0}, {NULL, NULL} /* sentinel */ }; @@ -436,10 +436,10 @@ /* List of functions defined in the module */ static PyMethodDef PyCurses_methods[] = { - {"bottom_panel", (PyCFunction)PyCurses_bottom_panel, METH_NOARGS}, + {"bottom_panel", (PyCFunction)PyCurses_bottom_panel, METH_ARGS, NULL, 0, 0}, {"new_panel", (PyCFunction)PyCurses_new_panel, METH_VARARGS}, - {"top_panel", (PyCFunction)PyCurses_top_panel, METH_NOARGS}, - {"update_panels", (PyCFunction)PyCurses_update_panels, METH_NOARGS}, + {"top_panel", (PyCFunction)PyCurses_top_panel, METH_ARGS, NULL, 0, 0}, + {"update_panels", (PyCFunction)PyCurses_update_panels, METH_ARGS, NULL, 0, 0}, {NULL, NULL} /* sentinel */ }; Index: Modules/_cursesmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_cursesmodule.c,v retrieving revision 2.73 diff -w -u -r2.73 _cursesmodule.c --- Modules/_cursesmodule.c 4 Aug 2004 14:33:28 -0000 2.73 +++ Modules/_cursesmodule.c 24 Jan 2005 23:36:18 -0000 @@ -1424,27 +1424,27 @@ {"bkgdset", (PyCFunction)PyCursesWindow_BkgdSet, METH_VARARGS}, {"border", (PyCFunction)PyCursesWindow_Border, METH_VARARGS}, {"box", (PyCFunction)PyCursesWindow_Box, METH_VARARGS}, - {"clear", (PyCFunction)PyCursesWindow_wclear, METH_NOARGS}, + {"clear", (PyCFunction)PyCursesWindow_wclear, METH_ARGS, NULL, 0, 0}, {"clearok", (PyCFunction)PyCursesWindow_clearok, METH_VARARGS}, - {"clrtobot", (PyCFunction)PyCursesWindow_wclrtobot, METH_NOARGS}, - {"clrtoeol", (PyCFunction)PyCursesWindow_wclrtoeol, METH_NOARGS}, - {"cursyncup", (PyCFunction)PyCursesWindow_wcursyncup, METH_NOARGS}, + {"clrtobot", (PyCFunction)PyCursesWindow_wclrtobot, METH_ARGS, NULL, 0, 0}, + {"clrtoeol", (PyCFunction)PyCursesWindow_wclrtoeol, METH_ARGS, NULL, 0, 0}, + {"cursyncup", (PyCFunction)PyCursesWindow_wcursyncup, METH_ARGS, NULL, 0, 0}, {"delch", (PyCFunction)PyCursesWindow_DelCh, METH_VARARGS}, - {"deleteln", (PyCFunction)PyCursesWindow_wdeleteln, METH_NOARGS}, + {"deleteln", (PyCFunction)PyCursesWindow_wdeleteln, METH_ARGS, NULL, 0, 0}, {"derwin", (PyCFunction)PyCursesWindow_DerWin, METH_VARARGS}, {"echochar", (PyCFunction)PyCursesWindow_EchoChar, METH_VARARGS}, #ifdef NCURSES_MOUSE_VERSION {"enclose", (PyCFunction)PyCursesWindow_Enclose, METH_VARARGS}, #endif - {"erase", (PyCFunction)PyCursesWindow_werase, METH_NOARGS}, - {"getbegyx", (PyCFunction)PyCursesWindow_getbegyx, METH_NOARGS}, - {"getbkgd", (PyCFunction)PyCursesWindow_GetBkgd, METH_NOARGS}, + {"erase", (PyCFunction)PyCursesWindow_werase, METH_ARGS, NULL, 0, 0}, + {"getbegyx", (PyCFunction)PyCursesWindow_getbegyx, METH_ARGS, NULL, 0, 0}, + {"getbkgd", (PyCFunction)PyCursesWindow_GetBkgd, METH_ARGS, NULL, 0, 0}, {"getch", (PyCFunction)PyCursesWindow_GetCh, METH_VARARGS}, {"getkey", (PyCFunction)PyCursesWindow_GetKey, METH_VARARGS}, - {"getmaxyx", (PyCFunction)PyCursesWindow_getmaxyx, METH_NOARGS}, - {"getparyx", (PyCFunction)PyCursesWindow_getparyx, METH_NOARGS}, + {"getmaxyx", (PyCFunction)PyCursesWindow_getmaxyx, METH_ARGS, NULL, 0, 0}, + {"getparyx", (PyCFunction)PyCursesWindow_getparyx, METH_ARGS, NULL, 0, 0}, {"getstr", (PyCFunction)PyCursesWindow_GetStr, METH_VARARGS}, - {"getyx", (PyCFunction)PyCursesWindow_getyx, METH_NOARGS}, + {"getyx", (PyCFunction)PyCursesWindow_getyx, METH_ARGS, NULL, 0, 0}, {"hline", (PyCFunction)PyCursesWindow_Hline, METH_VARARGS}, {"idcok", (PyCFunction)PyCursesWindow_idcok, METH_VARARGS}, {"idlok", (PyCFunction)PyCursesWindow_idlok, METH_VARARGS}, @@ -1452,12 +1452,12 @@ {"inch", (PyCFunction)PyCursesWindow_InCh, METH_VARARGS}, {"insch", (PyCFunction)PyCursesWindow_InsCh, METH_VARARGS}, {"insdelln", (PyCFunction)PyCursesWindow_winsdelln, METH_VARARGS}, - {"insertln", (PyCFunction)PyCursesWindow_winsertln, METH_NOARGS}, + {"insertln", (PyCFunction)PyCursesWindow_winsertln, METH_ARGS, NULL, 0, 0}, {"insnstr", (PyCFunction)PyCursesWindow_InsNStr, METH_VARARGS}, {"insstr", (PyCFunction)PyCursesWindow_InsStr, METH_VARARGS}, {"instr", (PyCFunction)PyCursesWindow_InStr, METH_VARARGS}, {"is_linetouched", (PyCFunction)PyCursesWindow_Is_LineTouched, METH_VARARGS}, - {"is_wintouched", (PyCFunction)PyCursesWindow_is_wintouched, METH_NOARGS}, + {"is_wintouched", (PyCFunction)PyCursesWindow_is_wintouched, METH_ARGS, NULL, 0, 0}, {"keypad", (PyCFunction)PyCursesWindow_keypad, METH_VARARGS}, {"leaveok", (PyCFunction)PyCursesWindow_leaveok, METH_VARARGS}, {"move", (PyCFunction)PyCursesWindow_wmove, METH_VARARGS}, @@ -1473,7 +1473,7 @@ METH_VARARGS}, {"putwin", (PyCFunction)PyCursesWindow_PutWin, METH_VARARGS}, {"redrawln", (PyCFunction)PyCursesWindow_RedrawLine}, - {"redrawwin", (PyCFunction)PyCursesWindow_redrawwin, METH_NOARGS}, + {"redrawwin", (PyCFunction)PyCursesWindow_redrawwin, METH_ARGS, NULL, 0, 0}, {"refresh", (PyCFunction)PyCursesWindow_Refresh, METH_VARARGS}, #ifndef STRICT_SYSV_CURSES {"resize", (PyCFunction)PyCursesWindow_wresize, METH_VARARGS}, @@ -1481,17 +1481,17 @@ {"scroll", (PyCFunction)PyCursesWindow_Scroll, METH_VARARGS}, {"scrollok", (PyCFunction)PyCursesWindow_scrollok, METH_VARARGS}, {"setscrreg", (PyCFunction)PyCursesWindow_SetScrollRegion, METH_VARARGS}, - {"standend", (PyCFunction)PyCursesWindow_wstandend, METH_NOARGS}, - {"standout", (PyCFunction)PyCursesWindow_wstandout, METH_NOARGS}, + {"standend", (PyCFunction)PyCursesWindow_wstandend, METH_ARGS, NULL, 0, 0}, + {"standout", (PyCFunction)PyCursesWindow_wstandout, METH_ARGS, NULL, 0, 0}, {"subpad", (PyCFunction)PyCursesWindow_SubWin, METH_VARARGS}, {"subwin", (PyCFunction)PyCursesWindow_SubWin, METH_VARARGS}, - {"syncdown", (PyCFunction)PyCursesWindow_wsyncdown, METH_NOARGS}, + {"syncdown", (PyCFunction)PyCursesWindow_wsyncdown, METH_ARGS, NULL, 0, 0}, {"syncok", (PyCFunction)PyCursesWindow_syncok, METH_VARARGS}, - {"syncup", (PyCFunction)PyCursesWindow_wsyncup, METH_NOARGS}, + {"syncup", (PyCFunction)PyCursesWindow_wsyncup, METH_ARGS, NULL, 0, 0}, {"timeout", (PyCFunction)PyCursesWindow_wtimeout, METH_VARARGS}, {"touchline", (PyCFunction)PyCursesWindow_TouchLine, METH_VARARGS}, - {"touchwin", (PyCFunction)PyCursesWindow_touchwin, METH_NOARGS}, - {"untouchwin", (PyCFunction)PyCursesWindow_untouchwin, METH_NOARGS}, + {"touchwin", (PyCFunction)PyCursesWindow_touchwin, METH_ARGS, NULL, 0, 0}, + {"untouchwin", (PyCFunction)PyCursesWindow_untouchwin, METH_ARGS, NULL, 0, 0}, {"vline", (PyCFunction)PyCursesWindow_Vline, METH_VARARGS}, {NULL, NULL} /* sentinel */ }; @@ -2375,46 +2375,46 @@ /* List of functions defined in the module */ static PyMethodDef PyCurses_methods[] = { - {"baudrate", (PyCFunction)PyCurses_baudrate, METH_NOARGS}, - {"beep", (PyCFunction)PyCurses_beep, METH_NOARGS}, - {"can_change_color", (PyCFunction)PyCurses_can_change_color, METH_NOARGS}, + {"baudrate", (PyCFunction)PyCurses_baudrate, METH_ARGS, NULL, 0, 0}, + {"beep", (PyCFunction)PyCurses_beep, METH_ARGS, NULL, 0, 0}, + {"can_change_color", (PyCFunction)PyCurses_can_change_color, METH_ARGS, NULL, 0, 0}, {"cbreak", (PyCFunction)PyCurses_cbreak, METH_VARARGS}, {"color_content", (PyCFunction)PyCurses_Color_Content, METH_VARARGS}, {"color_pair", (PyCFunction)PyCurses_color_pair, METH_VARARGS}, {"curs_set", (PyCFunction)PyCurses_Curs_Set, METH_VARARGS}, - {"def_prog_mode", (PyCFunction)PyCurses_def_prog_mode, METH_NOARGS}, - {"def_shell_mode", (PyCFunction)PyCurses_def_shell_mode, METH_NOARGS}, + {"def_prog_mode", (PyCFunction)PyCurses_def_prog_mode, METH_ARGS, NULL, 0, 0}, + {"def_shell_mode", (PyCFunction)PyCurses_def_shell_mode, METH_ARGS, NULL, 0, 0}, {"delay_output", (PyCFunction)PyCurses_Delay_Output, METH_VARARGS}, - {"doupdate", (PyCFunction)PyCurses_doupdate, METH_NOARGS}, + {"doupdate", (PyCFunction)PyCurses_doupdate, METH_ARGS, NULL, 0, 0}, {"echo", (PyCFunction)PyCurses_echo, METH_VARARGS}, - {"endwin", (PyCFunction)PyCurses_endwin, METH_NOARGS}, - {"erasechar", (PyCFunction)PyCurses_EraseChar, METH_NOARGS}, - {"filter", (PyCFunction)PyCurses_filter, METH_NOARGS}, - {"flash", (PyCFunction)PyCurses_flash, METH_NOARGS}, - {"flushinp", (PyCFunction)PyCurses_flushinp, METH_NOARGS}, + {"endwin", (PyCFunction)PyCurses_endwin, METH_ARGS, NULL, 0, 0}, + {"erasechar", (PyCFunction)PyCurses_EraseChar, METH_ARGS, NULL, 0, 0}, + {"filter", (PyCFunction)PyCurses_filter, METH_ARGS, NULL, 0, 0}, + {"flash", (PyCFunction)PyCurses_flash, METH_ARGS, NULL, 0, 0}, + {"flushinp", (PyCFunction)PyCurses_flushinp, METH_ARGS, NULL, 0, 0}, #ifdef NCURSES_MOUSE_VERSION - {"getmouse", (PyCFunction)PyCurses_GetMouse, METH_NOARGS}, + {"getmouse", (PyCFunction)PyCurses_GetMouse, METH_ARGS, NULL, 0, 0}, {"ungetmouse", (PyCFunction)PyCurses_UngetMouse, METH_VARARGS}, #endif - {"getsyx", (PyCFunction)PyCurses_getsyx, METH_NOARGS}, - {"getwin", (PyCFunction)PyCurses_GetWin, METH_O}, - {"has_colors", (PyCFunction)PyCurses_has_colors, METH_NOARGS}, - {"has_ic", (PyCFunction)PyCurses_has_ic, METH_NOARGS}, - {"has_il", (PyCFunction)PyCurses_has_il, METH_NOARGS}, + {"getsyx", (PyCFunction)PyCurses_getsyx, METH_ARGS, NULL, 0, 0}, + {"getwin", (PyCFunction)PyCurses_GetWin, METH_ARGS, NULL, 1, 1}, + {"has_colors", (PyCFunction)PyCurses_has_colors, METH_ARGS, NULL, 0, 0}, + {"has_ic", (PyCFunction)PyCurses_has_ic, METH_ARGS, NULL, 0, 0}, + {"has_il", (PyCFunction)PyCurses_has_il, METH_ARGS, NULL, 0, 0}, #ifndef STRICT_SYSV_CURSES {"has_key", (PyCFunction)PyCurses_has_key, METH_VARARGS}, #endif {"halfdelay", (PyCFunction)PyCurses_HalfDelay, METH_VARARGS}, {"init_color", (PyCFunction)PyCurses_Init_Color, METH_VARARGS}, {"init_pair", (PyCFunction)PyCurses_Init_Pair, METH_VARARGS}, - {"initscr", (PyCFunction)PyCurses_InitScr, METH_NOARGS}, + {"initscr", (PyCFunction)PyCurses_InitScr, METH_ARGS, NULL, 0, 0}, {"intrflush", (PyCFunction)PyCurses_IntrFlush, METH_VARARGS}, - {"isendwin", (PyCFunction)PyCurses_isendwin, METH_NOARGS}, + {"isendwin", (PyCFunction)PyCurses_isendwin, METH_ARGS, NULL, 0, 0}, #if !defined(__NetBSD__) {"keyname", (PyCFunction)PyCurses_KeyName, METH_VARARGS}, #endif - {"killchar", (PyCFunction)PyCurses_KillChar, METH_NOARGS}, - {"longname", (PyCFunction)PyCurses_longname, METH_NOARGS}, + {"killchar", (PyCFunction)PyCurses_KillChar, METH_ARGS, NULL, 0, 0}, + {"longname", (PyCFunction)PyCurses_longname, METH_ARGS, NULL, 0, 0}, {"meta", (PyCFunction)PyCurses_Meta, METH_VARARGS}, #ifdef NCURSES_MOUSE_VERSION {"mouseinterval", (PyCFunction)PyCurses_MouseInterval, METH_VARARGS}, @@ -2424,26 +2424,26 @@ {"newpad", (PyCFunction)PyCurses_NewPad, METH_VARARGS}, {"newwin", (PyCFunction)PyCurses_NewWindow, METH_VARARGS}, {"nl", (PyCFunction)PyCurses_nl, METH_VARARGS}, - {"nocbreak", (PyCFunction)PyCurses_nocbreak, METH_NOARGS}, - {"noecho", (PyCFunction)PyCurses_noecho, METH_NOARGS}, - {"nonl", (PyCFunction)PyCurses_nonl, METH_NOARGS}, - {"noqiflush", (PyCFunction)PyCurses_noqiflush, METH_NOARGS}, - {"noraw", (PyCFunction)PyCurses_noraw, METH_NOARGS}, + {"nocbreak", (PyCFunction)PyCurses_nocbreak, METH_ARGS, NULL, 0, 0}, + {"noecho", (PyCFunction)PyCurses_noecho, METH_ARGS, NULL, 0, 0}, + {"nonl", (PyCFunction)PyCurses_nonl, METH_ARGS, NULL, 0, 0}, + {"noqiflush", (PyCFunction)PyCurses_noqiflush, METH_ARGS, NULL, 0, 0}, + {"noraw", (PyCFunction)PyCurses_noraw, METH_ARGS, NULL, 0, 0}, {"pair_content", (PyCFunction)PyCurses_Pair_Content, METH_VARARGS}, {"pair_number", (PyCFunction)PyCurses_pair_number, METH_VARARGS}, {"putp", (PyCFunction)PyCurses_Putp, METH_VARARGS}, {"qiflush", (PyCFunction)PyCurses_QiFlush, METH_VARARGS}, {"raw", (PyCFunction)PyCurses_raw, METH_VARARGS}, - {"reset_prog_mode", (PyCFunction)PyCurses_reset_prog_mode, METH_NOARGS}, - {"reset_shell_mode", (PyCFunction)PyCurses_reset_shell_mode, METH_NOARGS}, - {"resetty", (PyCFunction)PyCurses_resetty, METH_NOARGS}, - {"savetty", (PyCFunction)PyCurses_savetty, METH_NOARGS}, + {"reset_prog_mode", (PyCFunction)PyCurses_reset_prog_mode, METH_ARGS, NULL, 0, 0}, + {"reset_shell_mode", (PyCFunction)PyCurses_reset_shell_mode, METH_ARGS, NULL, 0, 0}, + {"resetty", (PyCFunction)PyCurses_resetty, METH_ARGS, NULL, 0, 0}, + {"savetty", (PyCFunction)PyCurses_savetty, METH_ARGS, NULL, 0, 0}, {"setsyx", (PyCFunction)PyCurses_setsyx, METH_VARARGS}, {"setupterm", (PyCFunction)PyCurses_setupterm, METH_VARARGS|METH_KEYWORDS}, - {"start_color", (PyCFunction)PyCurses_Start_Color, METH_NOARGS}, - {"termattrs", (PyCFunction)PyCurses_termattrs, METH_NOARGS}, - {"termname", (PyCFunction)PyCurses_termname, METH_NOARGS}, + {"start_color", (PyCFunction)PyCurses_Start_Color, METH_ARGS, NULL, 0, 0}, + {"termattrs", (PyCFunction)PyCurses_termattrs, METH_ARGS, NULL, 0, 0}, + {"termname", (PyCFunction)PyCurses_termname, METH_ARGS, NULL, 0, 0}, {"tigetflag", (PyCFunction)PyCurses_tigetflag, METH_VARARGS}, {"tigetnum", (PyCFunction)PyCurses_tigetnum, METH_VARARGS}, {"tigetstr", (PyCFunction)PyCurses_tigetstr, METH_VARARGS}, @@ -2453,7 +2453,7 @@ {"ungetch", (PyCFunction)PyCurses_UngetCh, METH_VARARGS}, {"use_env", (PyCFunction)PyCurses_Use_Env, METH_VARARGS}, #ifndef STRICT_SYSV_CURSES - {"use_default_colors", (PyCFunction)PyCurses_Use_Default_Colors, METH_NOARGS}, + {"use_default_colors", (PyCFunction)PyCurses_Use_Default_Colors, METH_ARGS, NULL, 0, 0}, #endif {NULL, NULL} /* sentinel */ }; Index: Modules/_heapqmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_heapqmodule.c,v retrieving revision 1.8 diff -w -u -r1.8 _heapqmodule.c --- Modules/_heapqmodule.c 28 Sep 2004 00:03:53 -0000 1.8 +++ Modules/_heapqmodule.c 24 Jan 2005 23:36:18 -0000 @@ -467,11 +467,11 @@ {"heappush", (PyCFunction)heappush, METH_VARARGS, heappush_doc}, {"heappop", (PyCFunction)heappop, - METH_O, heappop_doc}, + METH_ARGS, heappop_doc, 1, 1}, {"heapreplace", (PyCFunction)heapreplace, METH_VARARGS, heapreplace_doc}, {"heapify", (PyCFunction)heapify, - METH_O, heapify_doc}, + METH_ARGS, heapify_doc, 1, 1}, {"nlargest", (PyCFunction)nlargest, METH_VARARGS, nlargest_doc}, {"nsmallest", (PyCFunction)nsmallest, Index: Modules/_hotshot.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_hotshot.c,v retrieving revision 1.37 diff -w -u -r1.37 _hotshot.c --- Modules/_hotshot.c 3 Aug 2004 08:33:55 -0000 1.37 +++ Modules/_hotshot.c 24 Jan 2005 23:36:18 -0000 @@ -1189,12 +1189,12 @@ static PyMethodDef profiler_methods[] = { {"addinfo", (PyCFunction)profiler_addinfo, METH_VARARGS, addinfo__doc__}, - {"close", (PyCFunction)profiler_close, METH_NOARGS, close__doc__}, - {"fileno", (PyCFunction)profiler_fileno, METH_NOARGS, fileno__doc__}, + {"close", (PyCFunction)profiler_close, METH_ARGS, close__doc__, 0, 0}, + {"fileno", (PyCFunction)profiler_fileno, METH_ARGS, fileno__doc__, 0, 0}, {"runcall", (PyCFunction)profiler_runcall, METH_VARARGS, runcall__doc__}, {"runcode", (PyCFunction)profiler_runcode, METH_VARARGS, runcode__doc__}, - {"start", (PyCFunction)profiler_start, METH_NOARGS, start__doc__}, - {"stop", (PyCFunction)profiler_stop, METH_NOARGS, stop__doc__}, + {"start", (PyCFunction)profiler_start, METH_ARGS, start__doc__, 0, 0}, + {"stop", (PyCFunction)profiler_stop, METH_ARGS, stop__doc__, 0, 0}, {NULL, NULL} }; @@ -1279,10 +1279,10 @@ static PyMethodDef logreader_methods[] = { - {"close", (PyCFunction)logreader_close, METH_NOARGS, - logreader_close__doc__}, - {"fileno", (PyCFunction)logreader_fileno, METH_NOARGS, - logreader_fileno__doc__}, + {"close", (PyCFunction)logreader_close, METH_ARGS, + logreader_close__doc__, 0, 0}, + {"fileno", (PyCFunction)logreader_fileno, METH_ARGS, + logreader_fileno__doc__, 0, 0}, {NULL, NULL} }; Index: Modules/_localemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_localemodule.c,v retrieving revision 2.50 diff -w -u -r2.50 _localemodule.c --- Modules/_localemodule.c 22 Nov 2004 13:02:30 -0000 2.50 +++ Modules/_localemodule.c 24 Jan 2005 23:36:19 -0000 @@ -675,13 +675,13 @@ {"setlocale", (PyCFunction) PyLocale_setlocale, METH_VARARGS, setlocale__doc__}, {"localeconv", (PyCFunction) PyLocale_localeconv, - METH_NOARGS, localeconv__doc__}, + METH_ARGS, localeconv__doc__, 0, 0}, {"strcoll", (PyCFunction) PyLocale_strcoll, METH_VARARGS, strcoll__doc__}, {"strxfrm", (PyCFunction) PyLocale_strxfrm, METH_VARARGS, strxfrm__doc__}, #if defined(MS_WINDOWS) || defined(__APPLE__) - {"_getdefaultlocale", (PyCFunction) PyLocale_getdefaultlocale, METH_NOARGS}, + {"_getdefaultlocale", (PyCFunction) PyLocale_getdefaultlocale, METH_ARGS, NULL, 0, 0}, #endif #ifdef HAVE_LANGINFO_H {"nl_langinfo", (PyCFunction) PyLocale_nl_langinfo, Index: Modules/_randommodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_randommodule.c,v retrieving revision 1.7 diff -w -u -r1.7 _randommodule.c --- Modules/_randommodule.c 5 Oct 2003 09:09:15 -0000 1.7 +++ Modules/_randommodule.c 24 Jan 2005 23:36:19 -0000 @@ -494,17 +494,17 @@ } static PyMethodDef random_methods[] = { - {"random", (PyCFunction)random_random, METH_NOARGS, - PyDoc_STR("random() -> x in the interval [0, 1).")}, + {"random", (PyCFunction)random_random, METH_ARGS, + PyDoc_STR("random() -> x in the interval [0, 1)."), 0, 0}, {"seed", (PyCFunction)random_seed, METH_VARARGS, PyDoc_STR("seed([n]) -> None. Defaults to current time.")}, - {"getstate", (PyCFunction)random_getstate, METH_NOARGS, - PyDoc_STR("getstate() -> tuple containing the current state.")}, - {"setstate", (PyCFunction)random_setstate, METH_O, - PyDoc_STR("setstate(state) -> None. Restores generator state.")}, - {"jumpahead", (PyCFunction)random_jumpahead, METH_O, + {"getstate", (PyCFunction)random_getstate, METH_ARGS, + PyDoc_STR("getstate() -> tuple containing the current state."), 0, 0}, + {"setstate", (PyCFunction)random_setstate, METH_ARGS, + PyDoc_STR("setstate(state) -> None. Restores generator state."), 1, 1}, + {"jumpahead", (PyCFunction)random_jumpahead, METH_ARGS, PyDoc_STR("jumpahead(int) -> None. Create new state from " - "existing state and integer.")}, + "existing state and integer."), 1, 1}, {"getrandbits", (PyCFunction)random_getrandbits, METH_VARARGS, PyDoc_STR("getrandbits(k) -> x. Generates a long int with " "k random bits.")}, Index: Modules/_ssl.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_ssl.c,v retrieving revision 1.19 diff -w -u -r1.19 _ssl.c --- Modules/_ssl.c 4 Aug 2004 14:59:00 -0000 1.19 +++ Modules/_ssl.c 24 Jan 2005 23:36:19 -0000 @@ -512,8 +512,8 @@ PySSL_SSLwrite_doc}, {"read", (PyCFunction)PySSL_SSLread, METH_VARARGS, PySSL_SSLread_doc}, - {"server", (PyCFunction)PySSL_server, METH_NOARGS}, - {"issuer", (PyCFunction)PySSL_issuer, METH_NOARGS}, + {"server", (PyCFunction)PySSL_server, METH_ARGS, NULL, 0, 0}, + {"issuer", (PyCFunction)PySSL_issuer, METH_ARGS, NULL, 0, 0}, {NULL, NULL} }; @@ -613,10 +613,10 @@ #ifdef HAVE_OPENSSL_RAND {"RAND_add", PySSL_RAND_add, METH_VARARGS, PySSL_RAND_add_doc}, - {"RAND_egd", PySSL_RAND_egd, METH_O, - PySSL_RAND_egd_doc}, - {"RAND_status", (PyCFunction)PySSL_RAND_status, METH_NOARGS, - PySSL_RAND_status_doc}, + {"RAND_egd", PySSL_RAND_egd, METH_ARGS, + PySSL_RAND_egd_doc, 1, 1}, + {"RAND_status", (PyCFunction)PySSL_RAND_status, METH_ARGS, + PySSL_RAND_status_doc, 0, 0}, #endif {NULL, NULL} /* Sentinel */ }; Index: Modules/_testcapimodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_testcapimodule.c,v retrieving revision 1.25 diff -w -u -r1.25 _testcapimodule.c --- Modules/_testcapimodule.c 15 Aug 2003 13:03:30 -0000 1.25 +++ Modules/_testcapimodule.c 24 Jan 2005 23:36:19 -0000 @@ -590,12 +590,12 @@ static PyMethodDef TestMethods[] = { {"raise_exception", raise_exception, METH_VARARGS}, - {"test_config", (PyCFunction)test_config, METH_NOARGS}, - {"test_list_api", (PyCFunction)test_list_api, METH_NOARGS}, - {"test_dict_iteration", (PyCFunction)test_dict_iteration,METH_NOARGS}, - {"test_long_api", (PyCFunction)test_long_api, METH_NOARGS}, - {"test_long_numbits", (PyCFunction)test_long_numbits, METH_NOARGS}, - {"test_k_code", (PyCFunction)test_k_code, METH_NOARGS}, + {"test_config", (PyCFunction)test_config, METH_ARGS, NULL, 0, 0}, + {"test_list_api", (PyCFunction)test_list_api, METH_ARGS, NULL, 0, 0}, + {"test_dict_iteration", (PyCFunction)test_dict_iteration,METH_ARGS, NULL, 0, 0}, + {"test_long_api", (PyCFunction)test_long_api, METH_ARGS, NULL, 0, 0}, + {"test_long_numbits", (PyCFunction)test_long_numbits, METH_ARGS, NULL, 0, 0}, + {"test_k_code", (PyCFunction)test_k_code, METH_ARGS, NULL, 0, 0}, {"getargs_b", (PyCFunction)getargs_b, METH_VARARGS}, {"getargs_B", (PyCFunction)getargs_B, METH_VARARGS}, @@ -607,11 +607,11 @@ #ifdef HAVE_LONG_LONG {"getargs_L", (PyCFunction)getargs_L, METH_VARARGS}, {"getargs_K", (PyCFunction)getargs_K, METH_VARARGS}, - {"test_longlong_api", (PyCFunction)test_longlong_api, METH_NOARGS}, - {"test_L_code", (PyCFunction)test_L_code, METH_NOARGS}, + {"test_longlong_api", (PyCFunction)test_longlong_api, METH_ARGS, NULL, 0, 0}, + {"test_L_code", (PyCFunction)test_L_code, METH_ARGS, NULL, 0, 0}, #endif #ifdef Py_USING_UNICODE - {"test_u_code", (PyCFunction)test_u_code, METH_NOARGS}, + {"test_u_code", (PyCFunction)test_u_code, METH_ARGS, NULL, 0, 0}, #endif #ifdef WITH_THREAD {"_test_thread_state", (PyCFunction)test_thread_state, METH_VARARGS}, Index: Modules/_tkinter.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_tkinter.c,v retrieving revision 1.168 diff -w -u -r1.168 _tkinter.c --- Modules/_tkinter.c 13 Nov 2004 11:13:35 -0000 1.168 +++ Modules/_tkinter.c 24 Jan 2005 23:36:19 -0000 @@ -838,8 +838,8 @@ }; static PyMethodDef PyTclObject_methods[] = { - {"__unicode__", (PyCFunction)PyTclObject_unicode, METH_NOARGS, - PyTclObject_unicode__doc__}, + {"__unicode__", (PyCFunction)PyTclObject_unicode, METH_ARGS, + PyTclObject_unicode__doc__, 0, 0}, {0} }; @@ -2665,7 +2665,7 @@ static PyMethodDef Tkapp_methods[] = { - {"willdispatch", Tkapp_WillDispatch, METH_NOARGS}, + {"willdispatch", Tkapp_WillDispatch, METH_ARGS, NULL, 0, 0}, {"wantobjects", Tkapp_WantObjects, METH_VARARGS}, {"call", Tkapp_Call, METH_OLDARGS}, {"globalcall", Tkapp_GlobalCall, METH_OLDARGS}, @@ -2701,7 +2701,7 @@ {"dooneevent", Tkapp_DoOneEvent, METH_VARARGS}, {"quit", Tkapp_Quit, METH_VARARGS}, {"interpaddr", Tkapp_InterpAddr, METH_VARARGS}, - {"loadtk", Tkapp_TkInit, METH_NOARGS}, + {"loadtk", Tkapp_TkInit, METH_ARGS, NULL, 0, 0}, {NULL, NULL} }; @@ -2939,7 +2939,7 @@ {"setbusywaitinterval",Tkinter_setbusywaitinterval, METH_VARARGS, setbusywaitinterval_doc}, {"getbusywaitinterval",(PyCFunction)Tkinter_getbusywaitinterval, - METH_NOARGS, getbusywaitinterval_doc}, + METH_ARGS, getbusywaitinterval_doc, 0, 0}, {NULL, NULL} }; Index: Modules/_weakref.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_weakref.c,v retrieving revision 1.19 diff -w -u -r1.19 _weakref.c --- Modules/_weakref.c 2 Jul 2004 18:57:43 -0000 1.19 +++ Modules/_weakref.c 24 Jan 2005 23:36:20 -0000 @@ -78,10 +78,10 @@ static PyMethodDef weakref_functions[] = { - {"getweakrefcount", weakref_getweakrefcount, METH_O, - weakref_getweakrefcount__doc__}, - {"getweakrefs", weakref_getweakrefs, METH_O, - weakref_getweakrefs__doc__}, + {"getweakrefcount", weakref_getweakrefcount, METH_ARGS, + weakref_getweakrefcount__doc__, 1, 1}, + {"getweakrefs", weakref_getweakrefs, METH_ARGS, + weakref_getweakrefs__doc__, 1, 1}, {"proxy", weakref_proxy, METH_VARARGS, weakref_proxy__doc__}, {NULL, NULL, 0, NULL} Index: Modules/arraymodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/arraymodule.c,v retrieving revision 2.98 diff -w -u -r2.98 arraymodule.c --- Modules/arraymodule.c 16 Dec 2004 16:23:39 -0000 2.98 +++ Modules/arraymodule.c 24 Jan 2005 23:36:20 -0000 @@ -1481,58 +1481,58 @@ }; PyMethodDef array_methods[] = { - {"append", (PyCFunction)array_append, METH_O, - append_doc}, - {"buffer_info", (PyCFunction)array_buffer_info, METH_NOARGS, - buffer_info_doc}, - {"byteswap", (PyCFunction)array_byteswap, METH_NOARGS, - byteswap_doc}, - {"__copy__", (PyCFunction)array_copy, METH_NOARGS, - copy_doc}, - {"count", (PyCFunction)array_count, METH_O, - count_doc}, - {"__deepcopy__",(PyCFunction)array_copy, METH_NOARGS, - copy_doc}, - {"extend", (PyCFunction)array_extend, METH_O, - extend_doc}, + {"append", (PyCFunction)array_append, METH_ARGS, + append_doc, 1, 1}, + {"buffer_info", (PyCFunction)array_buffer_info, METH_ARGS, + buffer_info_doc, 0, 0}, + {"byteswap", (PyCFunction)array_byteswap, METH_ARGS, + byteswap_doc, 0, 0}, + {"__copy__", (PyCFunction)array_copy, METH_ARGS, + copy_doc, 0, 0}, + {"count", (PyCFunction)array_count, METH_ARGS, + count_doc, 1, 1}, + {"__deepcopy__",(PyCFunction)array_copy, METH_ARGS, + copy_doc, 0, 0}, + {"extend", (PyCFunction)array_extend, METH_ARGS, + extend_doc, 1, 1}, {"fromfile", (PyCFunction)array_fromfile, METH_VARARGS, fromfile_doc}, - {"fromlist", (PyCFunction)array_fromlist, METH_O, - fromlist_doc}, + {"fromlist", (PyCFunction)array_fromlist, METH_ARGS, + fromlist_doc, 1, 1}, {"fromstring", (PyCFunction)array_fromstring, METH_VARARGS, fromstring_doc}, #ifdef Py_USING_UNICODE {"fromunicode", (PyCFunction)array_fromunicode, METH_VARARGS, fromunicode_doc}, #endif - {"index", (PyCFunction)array_index, METH_O, - index_doc}, + {"index", (PyCFunction)array_index, METH_ARGS, + index_doc, 1, 1}, {"insert", (PyCFunction)array_insert, METH_VARARGS, insert_doc}, {"pop", (PyCFunction)array_pop, METH_VARARGS, pop_doc}, {"read", (PyCFunction)array_fromfile, METH_VARARGS, fromfile_doc}, - {"__reduce__", (PyCFunction)array_reduce, METH_NOARGS, - array_doc}, - {"remove", (PyCFunction)array_remove, METH_O, - remove_doc}, - {"reverse", (PyCFunction)array_reverse, METH_NOARGS, - reverse_doc}, + {"__reduce__", (PyCFunction)array_reduce, METH_ARGS, + array_doc, 0, 0}, + {"remove", (PyCFunction)array_remove, METH_ARGS, + remove_doc, 1, 1}, + {"reverse", (PyCFunction)array_reverse, METH_ARGS, + reverse_doc, 0, 0}, /* {"sort", (PyCFunction)array_sort, METH_VARARGS, sort_doc},*/ - {"tofile", (PyCFunction)array_tofile, METH_O, - tofile_doc}, - {"tolist", (PyCFunction)array_tolist, METH_NOARGS, - tolist_doc}, - {"tostring", (PyCFunction)array_tostring, METH_NOARGS, - tostring_doc}, + {"tofile", (PyCFunction)array_tofile, METH_ARGS, + tofile_doc, 1, 1}, + {"tolist", (PyCFunction)array_tolist, METH_ARGS, + tolist_doc, 0, 0}, + {"tostring", (PyCFunction)array_tostring, METH_ARGS, + tostring_doc, 0, 0}, #ifdef Py_USING_UNICODE - {"tounicode", (PyCFunction)array_tounicode, METH_NOARGS, - tounicode_doc}, + {"tounicode", (PyCFunction)array_tounicode, METH_ARGS, + tounicode_doc, 0, 0}, #endif - {"write", (PyCFunction)array_tofile, METH_O, - tofile_doc}, + {"write", (PyCFunction)array_tofile, METH_ARGS, + tofile_doc, 1, 1}, {NULL, NULL} /* sentinel */ }; Index: Modules/bsddbmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/bsddbmodule.c,v retrieving revision 1.39 diff -w -u -r1.39 bsddbmodule.c --- Modules/bsddbmodule.c 6 May 2003 20:38:52 -0000 1.39 +++ Modules/bsddbmodule.c 24 Jan 2005 23:36:20 -0000 @@ -638,15 +638,15 @@ return PyInt_FromLong(status = 0); } static PyMethodDef bsddb_methods[] = { - {"close", (PyCFunction)bsddb_close, METH_NOARGS}, - {"keys", (PyCFunction)bsddb_keys, METH_NOARGS}, + {"close", (PyCFunction)bsddb_close, METH_ARGS, NULL, 0, 0}, + {"keys", (PyCFunction)bsddb_keys, METH_ARGS NULL, 0, 0}, {"has_key", (PyCFunction)bsddb_has_key, METH_VARARGS}, {"set_location", (PyCFunction)bsddb_set_location, METH_VARARGS}, - {"next", (PyCFunction)bsddb_next, METH_NOARGS}, - {"previous", (PyCFunction)bsddb_previous, METH_NOARGS}, - {"first", (PyCFunction)bsddb_first, METH_NOARGS}, - {"last", (PyCFunction)bsddb_last, METH_NOARGS}, - {"sync", (PyCFunction)bsddb_sync, METH_NOARGS}, + {"next", (PyCFunction)bsddb_next, METH_ARGS NULL, 0, 0}, + {"previous", (PyCFunction)bsddb_previous, METH_ARGS NULL, 0, 0}, + {"first", (PyCFunction)bsddb_first, METH_ARGS NULL, 0, 0}, + {"last", (PyCFunction)bsddb_last, METH_ARGS NULL, 0, 0}, + {"sync", (PyCFunction)bsddb_sync, METH_ARGS NULL, 0, 0}, {NULL, NULL} /* sentinel */ }; Index: Modules/bz2module.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/bz2module.c,v retrieving revision 1.23 diff -w -u -r1.23 bz2module.c --- Modules/bz2module.c 1 Nov 2004 17:10:19 -0000 1.23 +++ Modules/bz2module.c 24 Jan 2005 23:36:21 -0000 @@ -1165,10 +1165,10 @@ {"readlines", (PyCFunction)BZ2File_readlines, METH_VARARGS, BZ2File_readlines__doc__}, {"xreadlines", (PyCFunction)BZ2File_getiter, METH_VARARGS, BZ2File_xreadlines__doc__}, {"write", (PyCFunction)BZ2File_write, METH_VARARGS, BZ2File_write__doc__}, - {"writelines", (PyCFunction)BZ2File_writelines, METH_O, BZ2File_writelines__doc__}, + {"writelines", (PyCFunction)BZ2File_writelines, METH_ARGS, BZ2File_writelines__doc__, 1, 1}, {"seek", (PyCFunction)BZ2File_seek, METH_VARARGS, BZ2File_seek__doc__}, - {"tell", (PyCFunction)BZ2File_tell, METH_NOARGS, BZ2File_tell__doc__}, - {"close", (PyCFunction)BZ2File_close, METH_NOARGS, BZ2File_close__doc__}, + {"tell", (PyCFunction)BZ2File_tell, METH_ARGS, BZ2File_tell__doc__, 0, 0}, + {"close", (PyCFunction)BZ2File_close, METH_ARGS, BZ2File_close__doc__, 0, 0}, {NULL, NULL} /* sentinel */ }; @@ -1626,8 +1626,8 @@ static PyMethodDef BZ2Comp_methods[] = { {"compress", (PyCFunction)BZ2Comp_compress, METH_VARARGS, BZ2Comp_compress__doc__}, - {"flush", (PyCFunction)BZ2Comp_flush, METH_NOARGS, - BZ2Comp_flush__doc__}, + {"flush", (PyCFunction)BZ2Comp_flush, METH_ARGS, + BZ2Comp_flush__doc__, 0, 0}, {NULL, NULL} /* sentinel */ }; Index: Modules/cPickle.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cPickle.c,v retrieving revision 2.152 diff -w -u -r2.152 cPickle.c --- Modules/cPickle.c 7 Dec 2004 07:05:57 -0000 2.152 +++ Modules/cPickle.c 24 Jan 2005 23:36:22 -0000 @@ -2740,8 +2740,8 @@ {"dump", (PyCFunction)Pickler_dump, METH_VARARGS, PyDoc_STR("dump(object) -- " "Write an object in pickle format to the object's pickle stream")}, - {"clear_memo", (PyCFunction)Pickle_clear_memo, METH_NOARGS, - PyDoc_STR("clear_memo() -- Clear the picklers memo")}, + {"clear_memo", (PyCFunction)Pickle_clear_memo, METH_ARGS, + PyDoc_STR("clear_memo() -- Clear the picklers memo"), 0, 0}, {"getvalue", (PyCFunction)Pickle_getvalue, METH_VARARGS, PyDoc_STR("getvalue() -- Finish picking a list-based pickle")}, {NULL, NULL} /* sentinel */ Index: Modules/cStringIO.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cStringIO.c,v retrieving revision 2.49 diff -w -u -r2.49 cStringIO.c --- Modules/cStringIO.c 21 Aug 2004 06:55:43 -0000 2.49 +++ Modules/cStringIO.c 24 Jan 2005 23:36:22 -0000 @@ -449,21 +449,21 @@ static struct PyMethodDef O_methods[] = { /* Common methods: */ - {"flush", (PyCFunction)IO_flush, METH_NOARGS, IO_flush__doc__}, + {"flush", (PyCFunction)IO_flush, METH_ARGS, IO_flush__doc__, 0, 0}, {"getvalue", (PyCFunction)IO_getval, METH_VARARGS, IO_getval__doc__}, - {"isatty", (PyCFunction)IO_isatty, METH_NOARGS, IO_isatty__doc__}, + {"isatty", (PyCFunction)IO_isatty, METH_ARGS, IO_isatty__doc__, 0, 0}, {"read", (PyCFunction)IO_read, METH_VARARGS, IO_read__doc__}, {"readline", (PyCFunction)IO_readline, METH_VARARGS, IO_readline__doc__}, {"readlines", (PyCFunction)IO_readlines,METH_VARARGS, IO_readlines__doc__}, - {"reset", (PyCFunction)IO_reset, METH_NOARGS, IO_reset__doc__}, - {"tell", (PyCFunction)IO_tell, METH_NOARGS, IO_tell__doc__}, + {"reset", (PyCFunction)IO_reset, METH_ARGS, IO_reset__doc__, 0, 0}, + {"tell", (PyCFunction)IO_tell, METH_ARGS, IO_tell__doc__, 0, 0}, {"truncate", (PyCFunction)IO_truncate, METH_VARARGS, IO_truncate__doc__}, /* Read-write StringIO specific methods: */ - {"close", (PyCFunction)O_close, METH_NOARGS, O_close__doc__}, + {"close", (PyCFunction)O_close, METH_ARGS, O_close__doc__, 0, 0}, {"seek", (PyCFunction)O_seek, METH_VARARGS, O_seek__doc__}, {"write", (PyCFunction)O_write, METH_VARARGS, O_write__doc__}, - {"writelines", (PyCFunction)O_writelines, METH_O, O_writelines__doc__}, + {"writelines", (PyCFunction)O_writelines, METH_ARGS, O_writelines__doc__, 1, 1}, {NULL, NULL} /* sentinel */ }; @@ -575,18 +575,18 @@ static struct PyMethodDef I_methods[] = { /* Common methods: */ - {"flush", (PyCFunction)IO_flush, METH_NOARGS, IO_flush__doc__}, + {"flush", (PyCFunction)IO_flush, METH_ARGS, IO_flush__doc__, 0, 0}, {"getvalue", (PyCFunction)IO_getval, METH_VARARGS, IO_getval__doc__}, - {"isatty", (PyCFunction)IO_isatty, METH_NOARGS, IO_isatty__doc__}, + {"isatty", (PyCFunction)IO_isatty, METH_ARGS, IO_isatty__doc__, 0, 0}, {"read", (PyCFunction)IO_read, METH_VARARGS, IO_read__doc__}, {"readline", (PyCFunction)IO_readline, METH_VARARGS, IO_readline__doc__}, {"readlines", (PyCFunction)IO_readlines,METH_VARARGS, IO_readlines__doc__}, - {"reset", (PyCFunction)IO_reset, METH_NOARGS, IO_reset__doc__}, - {"tell", (PyCFunction)IO_tell, METH_NOARGS, IO_tell__doc__}, + {"reset", (PyCFunction)IO_reset, METH_ARGS, IO_reset__doc__, 0, 0}, + {"tell", (PyCFunction)IO_tell, METH_ARGS, IO_tell__doc__, 0, 0}, {"truncate", (PyCFunction)IO_truncate, METH_VARARGS, IO_truncate__doc__}, /* Read-only StringIO specific methods: */ - {"close", (PyCFunction)I_close, METH_NOARGS, O_close__doc__}, + {"close", (PyCFunction)I_close, METH_ARGS, O_close__doc__, 0, 0}, {"seek", (PyCFunction)I_seek, METH_VARARGS, O_seek__doc__}, {NULL, NULL} }; Index: Modules/clmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/clmodule.c,v retrieving revision 2.29 diff -w -u -r2.29 clmodule.c --- Modules/clmodule.c 27 Apr 2002 18:44:31 -0000 2.29 +++ Modules/clmodule.c 24 Jan 2005 23:36:22 -0000 @@ -589,8 +589,8 @@ } static PyMethodDef compressor_methods[] = { - {"close", clm_CloseCompressor, METH_NOARGS}, /* alias */ - {"CloseCompressor", clm_CloseCompressor, METH_NOARGS}, + {"close", clm_CloseCompressor, METH_ARGS, NULL, 0, 0}, /* alias */ + {"CloseCompressor", clm_CloseCompressor, METH_ARGS, NULL, 0, 0}, {"Compress", clm_Compress, METH_OLDARGS}, {"GetDefault", clm_GetDefault, METH_OLDARGS}, {"GetMinMax", clm_GetMinMax, METH_OLDARGS}, @@ -598,16 +598,16 @@ {"GetParam", clm_GetParam, METH_OLDARGS}, {"GetParamID", clm_GetParamID, METH_OLDARGS}, {"GetParams", clm_GetParams, METH_OLDARGS}, - {"QueryParams", clm_QueryParams, METH_NOARGS}, - {"QuerySchemeFromHandle",clm_QuerySchemeFromHandle, METH_NOARGS}, + {"QueryParams", clm_QueryParams, METH_ARGS, NULL, 0, 0}, + {"QuerySchemeFromHandle",clm_QuerySchemeFromHandle, METH_ARGS, NULL, 0, 0}, {"SetParam", clm_SetParam, METH_OLDARGS}, {"SetParams", clm_SetParams, METH_OLDARGS}, {NULL, NULL} /* sentinel */ }; static PyMethodDef decompressor_methods[] = { - {"close", clm_CloseDecompressor, METH_NOARGS}, /* alias */ - {"CloseDecompressor", clm_CloseDecompressor, METH_NOARGS}, + {"close", clm_CloseDecompressor, METH_ARGS, NULL, 0, 0}, /* alias */ + {"CloseDecompressor", clm_CloseDecompressor, METH_ARGS, NULL, 0, 0}, {"Decompress", clm_Decompress, METH_OLDARGS}, {"GetDefault", clm_GetDefault, METH_OLDARGS}, {"GetMinMax", clm_GetMinMax, METH_OLDARGS}, @@ -616,8 +616,8 @@ {"GetParamID", clm_GetParamID, METH_OLDARGS}, {"GetParams", clm_GetParams, METH_OLDARGS}, {"ReadHeader", clm_ReadHeader, METH_OLDARGS}, - {"QueryParams", clm_QueryParams, METH_NOARGS}, - {"QuerySchemeFromHandle",clm_QuerySchemeFromHandle, METH_NOARGS}, + {"QueryParams", clm_QueryParams, METH_ARGS, NULL, 0, 0}, + {"QuerySchemeFromHandle",clm_QuerySchemeFromHandle, METH_ARGS, NULL, 0, 0}, {"SetParam", clm_SetParam, METH_OLDARGS}, {"SetParams", clm_SetParams, METH_OLDARGS}, {NULL, NULL} /* sentinel */ Index: Modules/collectionsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/collectionsmodule.c,v retrieving revision 1.36 diff -w -u -r1.36 collectionsmodule.c --- Modules/collectionsmodule.c 9 Nov 2004 07:27:34 -0000 1.36 +++ Modules/collectionsmodule.c 24 Jan 2005 23:36:22 -0000 @@ -755,25 +755,25 @@ static PyMethodDef deque_methods[] = { {"append", (PyCFunction)deque_append, - METH_O, append_doc}, + METH_ARGS, append_doc, 1, 1}, {"appendleft", (PyCFunction)deque_appendleft, - METH_O, appendleft_doc}, + METH_ARGS, appendleft_doc, 1, 1}, {"clear", (PyCFunction)deque_clearmethod, - METH_NOARGS, clear_doc}, + METH_ARGS, clear_doc, 0, 0}, {"__copy__", (PyCFunction)deque_copy, - METH_NOARGS, copy_doc}, + METH_ARGS, copy_doc, 0, 0}, {"extend", (PyCFunction)deque_extend, - METH_O, extend_doc}, + METH_ARGS, extend_doc, 1, 1}, {"extendleft", (PyCFunction)deque_extendleft, - METH_O, extendleft_doc}, + METH_ARGS, extendleft_doc, 1, 1}, {"pop", (PyCFunction)deque_pop, - METH_NOARGS, pop_doc}, + METH_ARGS, pop_doc, 0, 0}, {"popleft", (PyCFunction)deque_popleft, - METH_NOARGS, popleft_doc}, + METH_ARGS, popleft_doc, 0, 0}, {"__reduce__", (PyCFunction)deque_reduce, - METH_NOARGS, reduce_doc}, + METH_ARGS, reduce_doc, 0, 0}, {"__reversed__", (PyCFunction)deque_reviter, - METH_NOARGS, reversed_doc}, + METH_ARGS, reversed_doc, 0, 0}, {"rotate", (PyCFunction)deque_rotate, METH_VARARGS, rotate_doc}, {NULL, NULL} /* sentinel */ Index: Modules/datetimemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/datetimemodule.c,v retrieving revision 1.77 diff -w -u -r1.77 datetimemodule.c --- Modules/datetimemodule.c 13 Jan 2005 04:12:31 -0000 1.77 +++ Modules/datetimemodule.c 24 Jan 2005 23:36:23 -0000 @@ -2067,8 +2067,8 @@ }; static PyMethodDef delta_methods[] = { - {"__reduce__", (PyCFunction)delta_reduce, METH_NOARGS, - PyDoc_STR("__reduce__() -> (cls, state)")}, + {"__reduce__", (PyCFunction)delta_reduce, METH_ARGS, + PyDoc_STR("__reduce__() -> (cls, state)"), 0, 0}, {NULL, NULL}, }; @@ -2615,45 +2615,45 @@ PyDoc_STR("int -> date corresponding to a proleptic Gregorian " "ordinal.")}, - {"today", (PyCFunction)date_today, METH_NOARGS | METH_CLASS, + {"today", (PyCFunction)date_today, METH_ARGS | METH_CLASS, PyDoc_STR("Current date or datetime: same as " - "self.__class__.fromtimestamp(time.time()).")}, + "self.__class__.fromtimestamp(time.time())."), 0, 0}, /* Instance methods: */ - {"ctime", (PyCFunction)date_ctime, METH_NOARGS, - PyDoc_STR("Return ctime() style string.")}, + {"ctime", (PyCFunction)date_ctime, METH_ARGS, + PyDoc_STR("Return ctime() style string."), 0, 0}, {"strftime", (PyCFunction)date_strftime, METH_KEYWORDS, PyDoc_STR("format -> strftime() style string.")}, - {"timetuple", (PyCFunction)date_timetuple, METH_NOARGS, - PyDoc_STR("Return time tuple, compatible with time.localtime().")}, + {"timetuple", (PyCFunction)date_timetuple, METH_ARGS, + PyDoc_STR("Return time tuple, compatible with time.localtime()."), 0, 0}, - {"isocalendar", (PyCFunction)date_isocalendar, METH_NOARGS, + {"isocalendar", (PyCFunction)date_isocalendar, METH_ARGS, PyDoc_STR("Return a 3-tuple containing ISO year, week number, and " - "weekday.")}, + "weekday."), 0, 0}, - {"isoformat", (PyCFunction)date_isoformat, METH_NOARGS, - PyDoc_STR("Return string in ISO 8601 format, YYYY-MM-DD.")}, + {"isoformat", (PyCFunction)date_isoformat, METH_ARGS, + PyDoc_STR("Return string in ISO 8601 format, YYYY-MM-DD."), 0, 0}, - {"isoweekday", (PyCFunction)date_isoweekday, METH_NOARGS, + {"isoweekday", (PyCFunction)date_isoweekday, METH_ARGS, PyDoc_STR("Return the day of the week represented by the date.\n" - "Monday == 1 ... Sunday == 7")}, + "Monday == 1 ... Sunday == 7"), 0, 0}, - {"toordinal", (PyCFunction)date_toordinal, METH_NOARGS, + {"toordinal", (PyCFunction)date_toordinal, METH_ARGS, PyDoc_STR("Return proleptic Gregorian ordinal. January 1 of year " - "1 is day 1.")}, + "1 is day 1."), 0, 0}, - {"weekday", (PyCFunction)date_weekday, METH_NOARGS, + {"weekday", (PyCFunction)date_weekday, METH_ARGS, PyDoc_STR("Return the day of the week represented by the date.\n" - "Monday == 0 ... Sunday == 6")}, + "Monday == 0 ... Sunday == 6"), 0, 0}, {"replace", (PyCFunction)date_replace, METH_KEYWORDS, PyDoc_STR("Return date with new specified fields.")}, - {"__reduce__", (PyCFunction)date_reduce, METH_NOARGS, - PyDoc_STR("__reduce__() -> (cls, state)")}, + {"__reduce__", (PyCFunction)date_reduce, METH_ARGS, + PyDoc_STR("__reduce__() -> (cls, state)"), 0, 0}, {NULL, NULL} }; @@ -2909,21 +2909,21 @@ static PyMethodDef tzinfo_methods[] = { - {"tzname", (PyCFunction)tzinfo_tzname, METH_O, - PyDoc_STR("datetime -> string name of time zone.")}, + {"tzname", (PyCFunction)tzinfo_tzname, METH_ARGS, + PyDoc_STR("datetime -> string name of time zone."), 1, 1}, - {"utcoffset", (PyCFunction)tzinfo_utcoffset, METH_O, + {"utcoffset", (PyCFunction)tzinfo_utcoffset, METH_ARGS, PyDoc_STR("datetime -> minutes east of UTC (negative for " - "west of UTC).")}, + "west of UTC)."), 1, 1}, - {"dst", (PyCFunction)tzinfo_dst, METH_O, - PyDoc_STR("datetime -> DST offset in minutes east of UTC.")}, + {"dst", (PyCFunction)tzinfo_dst, METH_ARGS, + PyDoc_STR("datetime -> DST offset in minutes east of UTC."), 1, 1}, - {"fromutc", (PyCFunction)tzinfo_fromutc, METH_O, - PyDoc_STR("datetime in UTC -> datetime in local time.")}, + {"fromutc", (PyCFunction)tzinfo_fromutc, METH_ARGS, + PyDoc_STR("datetime in UTC -> datetime in local time."), 1, 1}, - {"__reduce__", (PyCFunction)tzinfo_reduce, METH_NOARGS, - PyDoc_STR("-> (cls, state)")}, + {"__reduce__", (PyCFunction)tzinfo_reduce, METH_ARGS, + PyDoc_STR("-> (cls, state)"), 0, 0}, {NULL, NULL} }; @@ -3105,21 +3105,20 @@ * Indirect access to tzinfo methods. */ -/* These are all METH_NOARGS, so don't need to check the arglist. */ static PyObject * -time_utcoffset(PyDateTime_Time *self, PyObject *unused) { +time_utcoffset(PyDateTime_Time *self) { return offset_as_timedelta(HASTZINFO(self) ? self->tzinfo : Py_None, "utcoffset", Py_None); } static PyObject * -time_dst(PyDateTime_Time *self, PyObject *unused) { +time_dst(PyDateTime_Time *self) { return offset_as_timedelta(HASTZINFO(self) ? self->tzinfo : Py_None, "dst", Py_None); } static PyObject * -time_tzname(PyDateTime_Time *self, PyObject *unused) { +time_tzname(PyDateTime_Time *self) { return call_tzname(HASTZINFO(self) ? self->tzinfo : Py_None, Py_None); } @@ -3412,20 +3411,20 @@ {"strftime", (PyCFunction)time_strftime, METH_KEYWORDS, PyDoc_STR("format -> strftime() style string.")}, - {"utcoffset", (PyCFunction)time_utcoffset, METH_NOARGS, - PyDoc_STR("Return self.tzinfo.utcoffset(self).")}, + {"utcoffset", (PyCFunction)time_utcoffset, METH_ARGS, + PyDoc_STR("Return self.tzinfo.utcoffset(self)."), 0, 0}, - {"tzname", (PyCFunction)time_tzname, METH_NOARGS, - PyDoc_STR("Return self.tzinfo.tzname(self).")}, + {"tzname", (PyCFunction)time_tzname, METH_ARGS, + PyDoc_STR("Return self.tzinfo.tzname(self)."), 0, 0}, - {"dst", (PyCFunction)time_dst, METH_NOARGS, - PyDoc_STR("Return self.tzinfo.dst(self).")}, + {"dst", (PyCFunction)time_dst, METH_ARGS, + PyDoc_STR("Return self.tzinfo.dst(self)."), 0, 0}, {"replace", (PyCFunction)time_replace, METH_KEYWORDS, PyDoc_STR("Return time with new specified fields.")}, - {"__reduce__", (PyCFunction)time_reduce, METH_NOARGS, - PyDoc_STR("__reduce__() -> (cls, state)")}, + {"__reduce__", (PyCFunction)time_reduce, METH_ARGS, + PyDoc_STR("__reduce__() -> (cls, state)"), 0, 0}, {NULL, NULL} }; @@ -3884,21 +3883,20 @@ * Indirect access to tzinfo methods. */ -/* These are all METH_NOARGS, so don't need to check the arglist. */ static PyObject * -datetime_utcoffset(PyDateTime_DateTime *self, PyObject *unused) { +datetime_utcoffset(PyDateTime_DateTime *self) { return offset_as_timedelta(HASTZINFO(self) ? self->tzinfo : Py_None, "utcoffset", (PyObject *)self); } static PyObject * -datetime_dst(PyDateTime_DateTime *self, PyObject *unused) { +datetime_dst(PyDateTime_DateTime *self) { return offset_as_timedelta(HASTZINFO(self) ? self->tzinfo : Py_None, "dst", (PyObject *)self); } static PyObject * -datetime_tzname(PyDateTime_DateTime *self, PyObject *unused) { +datetime_tzname(PyDateTime_DateTime *self) { return call_tzname(HASTZINFO(self) ? self->tzinfo : Py_None, (PyObject *)self); } @@ -4447,8 +4445,8 @@ PyDoc_STR("[tz] -> new datetime with tz's local day and time.")}, {"utcnow", (PyCFunction)datetime_utcnow, - METH_NOARGS | METH_CLASS, - PyDoc_STR("Return a new datetime representing UTC day and time.")}, + METH_ARGS | METH_CLASS, + PyDoc_STR("Return a new datetime representing UTC day and time."), 0, 0}, {"fromtimestamp", (PyCFunction)datetime_fromtimestamp, METH_KEYWORDS | METH_CLASS, @@ -4470,23 +4468,23 @@ /* Instance methods: */ - {"date", (PyCFunction)datetime_getdate, METH_NOARGS, - PyDoc_STR("Return date object with same year, month and day.")}, + {"date", (PyCFunction)datetime_getdate, METH_ARGS, + PyDoc_STR("Return date object with same year, month and day."), 0, 0}, - {"time", (PyCFunction)datetime_gettime, METH_NOARGS, - PyDoc_STR("Return time object with same time but with tzinfo=None.")}, + {"time", (PyCFunction)datetime_gettime, METH_ARGS, + PyDoc_STR("Return time object with same time but with tzinfo=None."), 0, 0}, - {"timetz", (PyCFunction)datetime_gettimetz, METH_NOARGS, - PyDoc_STR("Return time object with same time and tzinfo.")}, + {"timetz", (PyCFunction)datetime_gettimetz, METH_ARGS, + PyDoc_STR("Return time object with same time and tzinfo."), 0, 0}, - {"ctime", (PyCFunction)datetime_ctime, METH_NOARGS, - PyDoc_STR("Return ctime() style string.")}, + {"ctime", (PyCFunction)datetime_ctime, METH_ARGS, + PyDoc_STR("Return ctime() style string."), 0, 0}, - {"timetuple", (PyCFunction)datetime_timetuple, METH_NOARGS, - PyDoc_STR("Return time tuple, compatible with time.localtime().")}, + {"timetuple", (PyCFunction)datetime_timetuple, METH_ARGS, + PyDoc_STR("Return time tuple, compatible with time.localtime()."), 0, 0}, - {"utctimetuple", (PyCFunction)datetime_utctimetuple, METH_NOARGS, - PyDoc_STR("Return UTC time tuple, compatible with time.localtime().")}, + {"utctimetuple", (PyCFunction)datetime_utctimetuple, METH_ARGS, + PyDoc_STR("Return UTC time tuple, compatible with time.localtime()."), 0, 0}, {"isoformat", (PyCFunction)datetime_isoformat, METH_KEYWORDS, PyDoc_STR("[sep] -> string in ISO 8601 format, " @@ -4494,14 +4492,14 @@ "sep is used to separate the year from the time, and " "defaults to 'T'.")}, - {"utcoffset", (PyCFunction)datetime_utcoffset, METH_NOARGS, - PyDoc_STR("Return self.tzinfo.utcoffset(self).")}, + {"utcoffset", (PyCFunction)datetime_utcoffset, METH_ARGS, + PyDoc_STR("Return self.tzinfo.utcoffset(self)."), 0, 0}, - {"tzname", (PyCFunction)datetime_tzname, METH_NOARGS, - PyDoc_STR("Return self.tzinfo.tzname(self).")}, + {"tzname", (PyCFunction)datetime_tzname, METH_ARGS, + PyDoc_STR("Return self.tzinfo.tzname(self)."), 0, 0}, - {"dst", (PyCFunction)datetime_dst, METH_NOARGS, - PyDoc_STR("Return self.tzinfo.dst(self).")}, + {"dst", (PyCFunction)datetime_dst, METH_ARGS, + PyDoc_STR("Return self.tzinfo.dst(self)."), 0, 0}, {"replace", (PyCFunction)datetime_replace, METH_KEYWORDS, PyDoc_STR("Return datetime with new specified fields.")}, @@ -4509,8 +4507,8 @@ {"astimezone", (PyCFunction)datetime_astimezone, METH_KEYWORDS, PyDoc_STR("tz -> convert to local time in new timezone tz\n")}, - {"__reduce__", (PyCFunction)datetime_reduce, METH_NOARGS, - PyDoc_STR("__reduce__() -> (cls, state)")}, + {"__reduce__", (PyCFunction)datetime_reduce, METH_ARGS, + PyDoc_STR("__reduce__() -> (cls, state)"), 0, 0}, {NULL, NULL} }; Index: Modules/dlmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/dlmodule.c,v retrieving revision 2.23 diff -w -u -r2.23 dlmodule.c --- Modules/dlmodule.c 2 Aug 2002 02:27:13 -0000 2.23 +++ Modules/dlmodule.c 24 Jan 2005 23:36:23 -0000 @@ -124,8 +124,8 @@ static PyMethodDef dlobject_methods[] = { {"call", (PyCFunction)dl_call, METH_VARARGS}, - {"sym", (PyCFunction)dl_sym, METH_O}, - {"close", (PyCFunction)dl_close, METH_NOARGS}, + {"sym", (PyCFunction)dl_sym, METH_ARGS, NULL, 1, 1}, + {"close", (PyCFunction)dl_close, METH_ARGS, NULL, 0, 0}, {NULL, NULL} /* Sentinel */ }; Index: Modules/flmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/flmodule.c,v retrieving revision 1.52 diff -w -u -r1.52 flmodule.c --- Modules/flmodule.c 12 Oct 2003 19:09:36 -0000 1.52 +++ Modules/flmodule.c 24 Jan 2005 23:36:24 -0000 @@ -251,16 +251,16 @@ static PyMethodDef generic_methods[] = { {"set_call_back", (PyCFunction)generic_set_call_back, METH_OLDARGS}, - {"delete_object", (PyCFunction)generic_delete_object, METH_NOARGS}, - {"show_object", (PyCFunction)generic_show_object, METH_NOARGS}, - {"hide_object", (PyCFunction)generic_hide_object, METH_NOARGS}, - {"redraw_object", (PyCFunction)generic_redraw_object, METH_NOARGS}, + {"delete_object", (PyCFunction)generic_delete_object, METH_ARGS, NULL, 0, 0}, + {"show_object", (PyCFunction)generic_show_object, METH_ARGS, NULL, 0, 0}, + {"hide_object", (PyCFunction)generic_hide_object, METH_ARGS, NULL, 0, 0}, + {"redraw_object", (PyCFunction)generic_redraw_object, METH_ARGS, NULL, 0, 0}, #ifdef OBSOLETE_FORMS_CALLS - {"freeze_object", (PyCFunction)generic_freeze_object, METH_NOARGS}, - {"unfreeze_object", (PyCFunction)generic_unfreeze_object, METH_NOARGS}, + {"freeze_object", (PyCFunction)generic_freeze_object, METH_ARGS, NULL, 0, 0}, + {"unfreeze_object", (PyCFunction)generic_unfreeze_object, METH_ARGS, NULL, 0, 0}, #endif - {"activate_object", (PyCFunction)generic_activate_object, METH_NOARGS}, - {"deactivate_object", (PyCFunction)generic_deactivate_object, METH_NOARGS}, + {"activate_object", (PyCFunction)generic_activate_object, METH_ARGS, NULL, 0, 0}, + {"deactivate_object", (PyCFunction)generic_deactivate_object, METH_ARGS, NULL, 0, 0}, {"set_object_shortcut", (PyCFunction)generic_set_object_shortcut, METH_OLDARGS}, {NULL, NULL} /* sentinel */ }; @@ -705,7 +705,7 @@ {"set_browser_topline", (PyCFunction)set_browser_topline, METH_OLDARGS}, {"clear_browser", (PyCFunction)clear_browser, - METH_NOARGS}, + METH_ARGS, NULL, 0, 0}, {"add_browser_line", (PyCFunction)add_browser_line, METH_OLDARGS}, {"addto_browser", (PyCFunction)addto_browser, @@ -721,17 +721,17 @@ {"load_browser", (PyCFunction)load_browser, METH_OLDARGS}, {"get_browser_maxline", (PyCFunction)get_browser_maxline, - METH_NOARGS,} + METH_ARGS, NULL, 0, 0} {"select_browser_line", (PyCFunction)select_browser_line, METH_OLDARGS}, {"deselect_browser_line", (PyCFunction)deselect_browser_line, METH_OLDARGS}, {"deselect_browser", (PyCFunction)deselect_browser, - METH_NOARGS,} + METH_ARGS, NULL, 0, 0} {"isselected_browser_line", (PyCFunction)isselected_browser_line, METH_OLDARGS}, {"get_browser", (PyCFunction)get_browser, - METH_NOARGS,} + METH_ARGS, NULL, 0, 0} {"set_browser_fontsize", (PyCFunction)set_browser_fontsize, METH_OLDARGS}, {"set_browser_fontstyle", (PyCFunction)set_browser_fontstyle, @@ -769,8 +769,8 @@ static PyMethodDef button_methods[] = { {"set_button", (PyCFunction)set_button, METH_OLDARGS}, - {"get_button", (PyCFunction)get_button, METH_NOARGS}, - {"get_button_numb", (PyCFunction)get_button_numb, METH_NOARGS}, + {"get_button", (PyCFunction)get_button, METH_ARGS, NULL, 0, 0}, + {"get_button_numb", (PyCFunction)get_button_numb, METH_ARGS, NULL, 0, 0}, {"set_button_shortcut", (PyCFunction)set_button_shortcut, METH_OLDARGS}, {NULL, NULL} /* sentinel */ }; @@ -833,12 +833,12 @@ static PyMethodDef choice_methods[] = { {"set_choice", (PyCFunction)set_choice, METH_OLDARGS}, - {"get_choice", (PyCFunction)get_choice, METH_NOARGS}, - {"clear_choice", (PyCFunction)clear_choice, METH_NOARGS}, + {"get_choice", (PyCFunction)get_choice, METH_ARGS, NULL, 0, 0}, + {"clear_choice", (PyCFunction)clear_choice, METH_ARGS, NULL, 0, 0}, {"addto_choice", (PyCFunction)addto_choice, METH_OLDARGS}, {"replace_choice", (PyCFunction)replace_choice, METH_OLDARGS}, {"delete_choice", (PyCFunction)delete_choice, METH_OLDARGS}, - {"get_choice_text", (PyCFunction)get_choice_text, METH_NOARGS}, + {"get_choice_text", (PyCFunction)get_choice_text, METH_ARGS, NULL, 0, 0}, {"set_choice_fontsize", (PyCFunction)set_choice_fontsize, METH_OLDARGS}, {"set_choice_fontstyle",(PyCFunction)set_choice_fontstyle, METH_OLDARGS}, {NULL, NULL} /* sentinel */ @@ -857,7 +857,7 @@ } static PyMethodDef clock_methods[] = { - {"get_clock", (PyCFunction)get_clock, METH_NOARGS}, + {"get_clock", (PyCFunction)get_clock, METH_ARGS, NULL, 0, 0}, {NULL, NULL} /* sentinel */ }; @@ -903,7 +903,7 @@ {"set_counter_value", (PyCFunction)set_counter_value, METH_OLDARGS}, {"get_counter_value", (PyCFunction)get_counter_value, - METH_NOARGS}, + METH_ARGS, NULL, 0, 0}, {"set_counter_bounds", (PyCFunction)set_counter_bounds, METH_OLDARGS}, {"set_counter_step", (PyCFunction)set_counter_step, @@ -950,9 +950,9 @@ static PyMethodDef dial_methods[] = { {"set_dial_value", (PyCFunction)set_dial_value, METH_OLDARGS}, - {"get_dial_value", (PyCFunction)get_dial_value, METH_NOARGS}, + {"get_dial_value", (PyCFunction)get_dial_value, METH_ARGS, NULL, 0, 0}, {"set_dial_bounds", (PyCFunction)set_dial_bounds, METH_OLDARGS}, - {"get_dial_bounds", (PyCFunction)get_dial_bounds, METH_NOARGS}, + {"get_dial_bounds", (PyCFunction)get_dial_bounds, METH_ARGS, NULL, 0, 0}, {"set_dial_step", (PyCFunction)set_dial_step, METH_OLDARGS}, {NULL, NULL} /* sentinel */ }; @@ -985,7 +985,7 @@ static PyMethodDef input_methods[] = { {"set_input", (PyCFunction)set_input, METH_OLDARGS}, - {"get_input", (PyCFunction)get_input, METH_NOARGS}, + {"get_input", (PyCFunction)get_input, METH_ARGS, NULL, 0, 0}, {"set_input_color", (PyCFunction)set_input_color, METH_OLDARGS}, {"set_input_return", (PyCFunction)set_input_return, METH_OLDARGS}, {NULL, NULL} /* sentinel */ @@ -1022,8 +1022,8 @@ static PyMethodDef menu_methods[] = { {"set_menu", (PyCFunction)set_menu, METH_OLDARGS}, - {"get_menu", (PyCFunction)get_menu, METH_NOARGS}, - {"get_menu_text", (PyCFunction)get_menu_text, METH_NOARGS}, + {"get_menu", (PyCFunction)get_menu, METH_ARGS, NULL, 0, 0}, + {"get_menu_text", (PyCFunction)get_menu_text, METH_ARGS, NULL, 0, 0}, {"addto_menu", (PyCFunction)addto_menu, METH_OLDARGS}, {NULL, NULL} /* sentinel */ }; @@ -1082,9 +1082,9 @@ static PyMethodDef slider_methods[] = { {"set_slider_value", (PyCFunction)set_slider_value, METH_OLDARGS}, - {"get_slider_value", (PyCFunction)get_slider_value, METH_NOARGS}, + {"get_slider_value", (PyCFunction)get_slider_value, METH_ARGS, NULL, 0, 0}, {"set_slider_bounds", (PyCFunction)set_slider_bounds, METH_OLDARGS}, - {"get_slider_bounds", (PyCFunction)get_slider_bounds, METH_NOARGS}, + {"get_slider_bounds", (PyCFunction)get_slider_bounds, METH_ARGS, NULL, 0, 0}, {"set_slider_return", (PyCFunction)set_slider_return, METH_OLDARGS}, {"set_slider_size", (PyCFunction)set_slider_size, METH_OLDARGS}, {"set_slider_precision",(PyCFunction)set_slider_precision, METH_OLDARGS}, @@ -1152,13 +1152,13 @@ {"set_positioner_ybounds", (PyCFunction)set_positioner_ybounds, METH_OLDARGS}, {"get_positioner_xvalue", (PyCFunction)get_positioner_xvalue, - METH_NOARGS}, + METH_ARGS, NULL, 0, 0}, {"get_positioner_yvalue", (PyCFunction)get_positioner_yvalue, - METH_NOARGS}, + METH_ARGS, NULL, 0, 0}, {"get_positioner_xbounds", (PyCFunction)get_positioner_xbounds, - METH_NOARGS}, + METH_ARGS, NULL, 0, 0}, {"get_positioner_ybounds", (PyCFunction)get_positioner_ybounds, - METH_NOARGS}, + METH_ARGS, NULL, 0, 0}, {NULL, NULL} /* sentinel */ }; @@ -1178,7 +1178,7 @@ static PyMethodDef timer_methods[] = { {"set_timer", (PyCFunction)set_timer, METH_OLDARGS}, - {"get_timer", (PyCFunction)get_timer, METH_NOARGS}, + {"get_timer", (PyCFunction)get_timer, METH_ARGS, NULL, 0, 0}, {NULL, NULL} /* sentinel */ }; @@ -1502,15 +1502,15 @@ static PyMethodDef form_methods[] = { /* adm */ {"show_form", (PyCFunction)form_show_form, METH_OLDARGS}, - {"hide_form", (PyCFunction)form_hide_form, METH_NOARGS}, - {"redraw_form", (PyCFunction)form_redraw_form, METH_NOARGS}, + {"hide_form", (PyCFunction)form_hide_form, METH_ARGS, NULL, 0, 0}, + {"redraw_form", (PyCFunction)form_redraw_form, METH_ARGS, NULL, 0, 0}, {"set_form_position", (PyCFunction)form_set_form_position, METH_OLDARGS}, {"set_form_size", (PyCFunction)form_set_form_size, METH_OLDARGS}, {"scale_form", (PyCFunction)form_scale_form, METH_OLDARGS}, - {"freeze_form", (PyCFunction)form_freeze_form, METH_NOARGS}, - {"unfreeze_form", (PyCFunction)form_unfreeze_form, METH_NOARGS}, - {"activate_form", (PyCFunction)form_activate_form, METH_NOARGS}, - {"deactivate_form", (PyCFunction)form_deactivate_form, METH_NOARGS}, + {"freeze_form", (PyCFunction)form_freeze_form, METH_ARGS, NULL, 0, 0}, + {"unfreeze_form", (PyCFunction)form_unfreeze_form, METH_ARGS, NULL, 0, 0}, + {"activate_form", (PyCFunction)form_activate_form, METH_ARGS, NULL, 0, 0}, + {"deactivate_form", (PyCFunction)form_deactivate_form, METH_ARGS, NULL, 0, 0}, {"bgn_group", (PyCFunction)form_bgn_group, METH_OLDARGS}, {"end_group", (PyCFunction)form_end_group, METH_OLDARGS}, {"find_first", (PyCFunction)form_find_first, METH_OLDARGS}, @@ -2095,19 +2095,19 @@ {"qtest", forms_qtest, METH_OLDARGS}, {"qread", forms_qread, METH_OLDARGS}, /* {"blkqread", forms_blkqread, METH_OLDARGS}, */ - {"qreset", forms_qreset, METH_NOARGS}, + {"qreset", forms_qreset, METH_ARGS, NULL, 0, 0}, {"qenter", forms_qenter, METH_OLDARGS}, - {"get_mouse", forms_get_mouse, METH_NOARGS}, + {"get_mouse", forms_get_mouse, METH_ARGS, NULL, 0, 0}, {"tie", forms_tie, METH_OLDARGS}, /* {"new_events", forms_new_events, METH_OLDARGS}, */ {"color", forms_color, METH_OLDARGS}, {"mapcolor", forms_mapcolor, METH_OLDARGS}, {"getmcolor", forms_getmcolor, METH_OLDARGS}, /* interaction */ - {"do_forms", forms_do_forms, METH_NOARGS}, - {"do_only_forms", forms_do_only_forms, METH_NOARGS}, - {"check_forms", forms_check_forms, METH_NOARGS}, - {"check_only_forms", forms_check_only_forms, METH_NOARGS}, + {"do_forms", forms_do_forms, METH_ARGS, NULL, 0, 0}, + {"do_only_forms", forms_do_only_forms, METH_ARGS, NULL, 0, 0}, + {"check_forms", forms_check_forms, METH_ARGS, NULL, 0, 0}, + {"check_only_forms", forms_check_only_forms, METH_ARGS, NULL, 0, 0}, {"set_event_call_back", forms_set_event_call_back, METH_OLDARGS}, /* goodies */ {"show_message", forms_show_message, METH_OLDARGS}, Index: Modules/fmmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/fmmodule.c,v retrieving revision 1.21 diff -w -u -r1.21 fmmodule.c --- Modules/fmmodule.c 17 Jul 2002 16:30:36 -0000 1.21 +++ Modules/fmmodule.c 24 Jan 2005 23:36:24 -0000 @@ -119,10 +119,10 @@ static PyMethodDef fh_methods[] = { {"scalefont", (PyCFunction)fh_scalefont, METH_OLDARGS}, - {"setfont", (PyCFunction)fh_setfont, METH_NOARGS}, - {"getfontname", (PyCFunction)fh_getfontname, METH_NOARGS}, - {"getcomment", (PyCFunction)fh_getcomment, METH_NOARGS}, - {"getfontinfo", (PyCFunction)fh_getfontinfo, METH_NOARGS}, + {"setfont", (PyCFunction)fh_setfont, METH_ARGS, NULL, 0, 0}, + {"getfontname", (PyCFunction)fh_getfontname, METH_ARGS, NULL, 0, 0}, + {"getcomment", (PyCFunction)fh_getcomment, METH_ARGS, NULL, 0, 0}, + {"getfontinfo", (PyCFunction)fh_getfontinfo, METH_ARGS, NULL, 0, 0}, #if 0 {"getwholemetrics", (PyCFunction)fh_getwholemetrics, METH_OLDARGS}, #endif @@ -244,12 +244,12 @@ } static PyMethodDef fm_methods[] = { - {"init", fm_init, METH_NOARGS}, + {"init", fm_init, METH_ARGS, NULL, 0, 0}, {"findfont", fm_findfont, METH_OLDARGS}, - {"enumerate", fm_enumerate, METH_NOARGS}, + {"enumerate", fm_enumerate, METH_ARGS, NULL, 0, 0}, {"prstr", fm_prstr, METH_OLDARGS}, {"setpath", fm_setpath, METH_OLDARGS}, - {"fontpath", fm_fontpath, METH_NOARGS}, + {"fontpath", fm_fontpath, METH_ARGS, NULL, 0, 0}, {NULL, NULL} /* sentinel */ }; Index: Modules/gcmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/gcmodule.c,v retrieving revision 2.80 diff -w -u -r2.80 gcmodule.c --- Modules/gcmodule.c 1 Nov 2004 16:39:57 -0000 2.80 +++ Modules/gcmodule.c 24 Jan 2005 23:36:24 -0000 @@ -1134,15 +1134,15 @@ "get_referents() -- Return the list of objects that an object refers to.\n"); static PyMethodDef GcMethods[] = { - {"enable", gc_enable, METH_NOARGS, gc_enable__doc__}, - {"disable", gc_disable, METH_NOARGS, gc_disable__doc__}, - {"isenabled", gc_isenabled, METH_NOARGS, gc_isenabled__doc__}, + {"enable", gc_enable, METH_ARGS, gc_enable__doc__, 0, 0}, + {"disable", gc_disable, METH_ARGS, gc_disable__doc__, 0, 0}, + {"isenabled", gc_isenabled, METH_ARGS, gc_isenabled__doc__, 0, 0}, {"set_debug", gc_set_debug, METH_VARARGS, gc_set_debug__doc__}, - {"get_debug", gc_get_debug, METH_NOARGS, gc_get_debug__doc__}, + {"get_debug", gc_get_debug, METH_ARGS, gc_get_debug__doc__, 0, 0}, {"set_threshold", gc_set_thresh, METH_VARARGS, gc_set_thresh__doc__}, - {"get_threshold", gc_get_thresh, METH_NOARGS, gc_get_thresh__doc__}, - {"collect", gc_collect, METH_NOARGS, gc_collect__doc__}, - {"get_objects", gc_get_objects,METH_NOARGS, gc_get_objects__doc__}, + {"get_threshold", gc_get_thresh, METH_ARGS, gc_get_thresh__doc__, 0, 0}, + {"collect", gc_collect, METH_ARGS, gc_collect__doc__, 0, 0}, + {"get_objects", gc_get_objects,METH_ARGS, gc_get_objects__doc__, 0, 0}, {"get_referrers", gc_get_referrers, METH_VARARGS, gc_get_referrers__doc__}, {"get_referents", gc_get_referents, METH_VARARGS, Index: Modules/glmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/glmodule.c,v retrieving revision 2.10 diff -w -u -r2.10 glmodule.c --- Modules/glmodule.c 28 Jul 2002 15:23:23 -0000 2.10 +++ Modules/glmodule.c 24 Jan 2005 23:36:26 -0000 @@ -7194,9 +7194,9 @@ {"nurbscurve", gl_nurbscurve, METH_OLDARGS}, {"pwlcurve", gl_pwlcurve, METH_OLDARGS}, {"pick", gl_pick, METH_OLDARGS}, - {"endpick", gl_endpick, METH_NOARGS}, + {"endpick", gl_endpick, METH_ARGS, NULL, 0, 0}, {"gselect", gl_gselect, METH_OLDARGS}, - {"endselect", gl_endselect, METH_NOARGS}, + {"endselect", gl_endselect, METH_ARGS, NULL, 0, 0}, {"getmatrix", gl_getmatrix, METH_OLDARGS}, {"altgetmatrix", gl_altgetmatrix, METH_OLDARGS}, {"lrectwrite", gl_lrectwrite, METH_OLDARGS}, Index: Modules/itertoolsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/itertoolsmodule.c,v retrieving revision 1.40 diff -w -u -r1.40 itertoolsmodule.c --- Modules/itertoolsmodule.c 5 Dec 2004 09:25:51 -0000 1.40 +++ Modules/itertoolsmodule.c 24 Jan 2005 23:36:27 -0000 @@ -508,7 +508,7 @@ "Iterator wrapped to make it copyable"); static PyMethodDef tee_methods[] = { - {"__copy__", (PyCFunction)tee_copy, METH_NOARGS, teecopy_doc}, + {"__copy__", (PyCFunction)tee_copy, METH_ARGS, teecopy_doc, 0, 0}, {NULL, NULL} /* sentinel */ }; Index: Modules/md5module.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/md5module.c,v retrieving revision 2.35 diff -w -u -r2.35 md5module.c --- Modules/md5module.c 8 Jul 2003 21:17:25 -0000 2.35 +++ Modules/md5module.c 24 Jan 2005 23:36:27 -0000 @@ -143,9 +143,9 @@ static PyMethodDef md5_methods[] = { {"update", (PyCFunction)md5_update, METH_VARARGS, update_doc}, - {"digest", (PyCFunction)md5_digest, METH_NOARGS, digest_doc}, - {"hexdigest", (PyCFunction)md5_hexdigest, METH_NOARGS, hexdigest_doc}, - {"copy", (PyCFunction)md5_copy, METH_NOARGS, copy_doc}, + {"digest", (PyCFunction)md5_digest, METH_ARGS, digest_doc, 0, 0}, + {"hexdigest", (PyCFunction)md5_hexdigest, METH_ARGS, hexdigest_doc, 0, 0}, + {"copy", (PyCFunction)md5_copy, METH_ARGS, copy_doc, 0, 0}, {NULL, NULL} /* sentinel */ }; Index: Modules/nismodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/nismodule.c,v retrieving revision 2.25 diff -w -u -r2.25 nismodule.c --- Modules/nismodule.c 10 Jul 2004 00:57:37 -0000 2.25 +++ Modules/nismodule.c 24 Jan 2005 23:36:27 -0000 @@ -370,7 +370,7 @@ static PyMethodDef nis_methods[] = { {"match", nis_match, METH_VARARGS}, {"cat", nis_cat, METH_VARARGS}, - {"maps", (PyCFunction)nis_maps, METH_NOARGS}, + {"maps", (PyCFunction)nis_maps, METH_ARGS, NULL, 0, 0}, {NULL, NULL} /* Sentinel */ }; Index: Modules/operator.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/operator.c,v retrieving revision 2.29 diff -w -u -r2.29 operator.c --- Modules/operator.c 4 Dec 2003 22:17:49 -0000 2.29 +++ Modules/operator.c 24 Jan 2005 23:36:27 -0000 @@ -179,9 +179,9 @@ #define spam1(OP,DOC) {#OP, OP, METH_VARARGS, PyDoc_STR(DOC)}, #define spam2(OP,ALTOP,DOC) {#OP, op_##OP, METH_VARARGS, DOC}, \ {#ALTOP, op_##OP, METH_VARARGS, PyDoc_STR(DOC)}, -#define spam1o(OP,DOC) {#OP, OP, METH_O, PyDoc_STR(DOC)}, -#define spam2o(OP,ALTOP,DOC) {#OP, op_##OP, METH_O, DOC}, \ - {#ALTOP, op_##OP, METH_O, PyDoc_STR(DOC)}, +#define spam1o(OP,DOC) {#OP, OP, METH_ARGS, PyDoc_STR(DOC), 1, 1}, +#define spam2o(OP,ALTOP,DOC) {#OP, op_##OP, METH_ARGS, DOC, 1, 1}, \ + {#ALTOP, op_##OP, METH_ARGS, PyDoc_STR(DOC), 1, 1}, static struct PyMethodDef operator_methods[] = { Index: Modules/posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.332 diff -w -u -r2.332 posixmodule.c --- Modules/posixmodule.c 16 Jan 2005 08:57:38 -0000 2.332 +++ Modules/posixmodule.c 24 Jan 2005 23:36:28 -0000 @@ -7302,12 +7302,12 @@ {"chroot", posix_chroot, METH_VARARGS, posix_chroot__doc__}, #endif #ifdef HAVE_CTERMID - {"ctermid", posix_ctermid, METH_NOARGS, posix_ctermid__doc__}, + {"ctermid", posix_ctermid, METH_ARGS, posix_ctermid__doc__, 0, 0}, #endif #ifdef HAVE_GETCWD - {"getcwd", posix_getcwd, METH_NOARGS, posix_getcwd__doc__}, + {"getcwd", posix_getcwd, METH_ARGS, posix_getcwd__doc__, 0, 0}, #ifdef Py_USING_UNICODE - {"getcwdu", posix_getcwdu, METH_NOARGS, posix_getcwdu__doc__}, + {"getcwdu", posix_getcwdu, METH_ARGS, posix_getcwdu__doc__, 0, 0}, #endif #endif #ifdef HAVE_LINK @@ -7334,13 +7334,13 @@ #endif {"umask", posix_umask, METH_VARARGS, posix_umask__doc__}, #ifdef HAVE_UNAME - {"uname", posix_uname, METH_NOARGS, posix_uname__doc__}, + {"uname", posix_uname, METH_ARGS, posix_uname__doc__, 0, 0}, #endif /* HAVE_UNAME */ {"unlink", posix_unlink, METH_VARARGS, posix_unlink__doc__}, {"remove", posix_unlink, METH_VARARGS, posix_remove__doc__}, {"utime", posix_utime, METH_VARARGS, posix_utime__doc__}, #ifdef HAVE_TIMES - {"times", posix_times, METH_NOARGS, posix_times__doc__}, + {"times", posix_times, METH_ARGS, posix_times__doc__, 0, 0}, #endif /* HAVE_TIMES */ {"_exit", posix__exit, METH_VARARGS, posix__exit__doc__}, #ifdef HAVE_EXECV @@ -7356,41 +7356,41 @@ #endif /* PYOS_OS2 */ #endif /* HAVE_SPAWNV */ #ifdef HAVE_FORK1 - {"fork1", posix_fork1, METH_NOARGS, posix_fork1__doc__}, + {"fork1", posix_fork1, METH_ARGS, posix_fork1__doc__, 0, 0}, #endif /* HAVE_FORK1 */ #ifdef HAVE_FORK - {"fork", posix_fork, METH_NOARGS, posix_fork__doc__}, + {"fork", posix_fork, METH_ARGS, posix_fork__doc__, 0, 0}, #endif /* HAVE_FORK */ #if defined(HAVE_OPENPTY) || defined(HAVE__GETPTY) || defined(HAVE_DEV_PTMX) - {"openpty", posix_openpty, METH_NOARGS, posix_openpty__doc__}, + {"openpty", posix_openpty, METH_ARGS, posix_openpty__doc__, 0, 0}, #endif /* HAVE_OPENPTY || HAVE__GETPTY || HAVE_DEV_PTMX */ #ifdef HAVE_FORKPTY - {"forkpty", posix_forkpty, METH_NOARGS, posix_forkpty__doc__}, + {"forkpty", posix_forkpty, METH_ARGS, posix_forkpty__doc__, 0, 0}, #endif /* HAVE_FORKPTY */ #ifdef HAVE_GETEGID - {"getegid", posix_getegid, METH_NOARGS, posix_getegid__doc__}, + {"getegid", posix_getegid, METH_ARGS, posix_getegid__doc__, 0, 0}, #endif /* HAVE_GETEGID */ #ifdef HAVE_GETEUID - {"geteuid", posix_geteuid, METH_NOARGS, posix_geteuid__doc__}, + {"geteuid", posix_geteuid, METH_ARGS, posix_geteuid__doc__, 0, 0}, #endif /* HAVE_GETEUID */ #ifdef HAVE_GETGID - {"getgid", posix_getgid, METH_NOARGS, posix_getgid__doc__}, + {"getgid", posix_getgid, METH_ARGS, posix_getgid__doc__, 0, 0}, #endif /* HAVE_GETGID */ #ifdef HAVE_GETGROUPS - {"getgroups", posix_getgroups, METH_NOARGS, posix_getgroups__doc__}, + {"getgroups", posix_getgroups, METH_ARGS, posix_getgroups__doc__, 0, 0}, #endif - {"getpid", posix_getpid, METH_NOARGS, posix_getpid__doc__}, + {"getpid", posix_getpid, METH_ARGS, posix_getpid__doc__, 0, 0}, #ifdef HAVE_GETPGRP - {"getpgrp", posix_getpgrp, METH_NOARGS, posix_getpgrp__doc__}, + {"getpgrp", posix_getpgrp, METH_ARGS, posix_getpgrp__doc__, 0, 0}, #endif /* HAVE_GETPGRP */ #ifdef HAVE_GETPPID - {"getppid", posix_getppid, METH_NOARGS, posix_getppid__doc__}, + {"getppid", posix_getppid, METH_ARGS, posix_getppid__doc__, 0, 0}, #endif /* HAVE_GETPPID */ #ifdef HAVE_GETUID - {"getuid", posix_getuid, METH_NOARGS, posix_getuid__doc__}, + {"getuid", posix_getuid, METH_ARGS, posix_getuid__doc__, 0, 0}, #endif /* HAVE_GETUID */ #ifdef HAVE_GETLOGIN - {"getlogin", posix_getlogin, METH_NOARGS, posix_getlogin__doc__}, + {"getlogin", posix_getlogin, METH_ARGS, posix_getlogin__doc__, 0, 0}, #endif #ifdef HAVE_KILL {"kill", posix_kill, METH_VARARGS, posix_kill__doc__}, @@ -7441,10 +7441,10 @@ {"getpgid", posix_getpgid, METH_VARARGS, posix_getpgid__doc__}, #endif /* HAVE_GETPGID */ #ifdef HAVE_SETPGRP - {"setpgrp", posix_setpgrp, METH_NOARGS, posix_setpgrp__doc__}, + {"setpgrp", posix_setpgrp, METH_ARGS, posix_setpgrp__doc__, 0, 0}, #endif /* HAVE_SETPGRP */ #ifdef HAVE_WAIT - {"wait", posix_wait, METH_NOARGS, posix_wait__doc__}, + {"wait", posix_wait, METH_ARGS, posix_wait__doc__, 0, 0}, #endif /* HAVE_WAIT */ #if defined(HAVE_WAITPID) || defined(HAVE_CWAIT) {"waitpid", posix_waitpid, METH_VARARGS, posix_waitpid__doc__}, @@ -7453,7 +7453,7 @@ {"getsid", posix_getsid, METH_VARARGS, posix_getsid__doc__}, #endif /* HAVE_GETSID */ #ifdef HAVE_SETSID - {"setsid", posix_setsid, METH_NOARGS, posix_setsid__doc__}, + {"setsid", posix_setsid, METH_ARGS, posix_setsid__doc__, 0, 0}, #endif /* HAVE_SETSID */ #ifdef HAVE_SETPGID {"setpgid", posix_setpgid, METH_VARARGS, posix_setpgid__doc__}, @@ -7475,7 +7475,7 @@ {"fdopen", posix_fdopen, METH_VARARGS, posix_fdopen__doc__}, {"isatty", posix_isatty, METH_VARARGS, posix_isatty__doc__}, #ifdef HAVE_PIPE - {"pipe", posix_pipe, METH_NOARGS, posix_pipe__doc__}, + {"pipe", posix_pipe, METH_ARGS, posix_pipe__doc__, 0, 0}, #endif #ifdef HAVE_MKFIFO {"mkfifo", posix_mkfifo, METH_VARARGS, posix_mkfifo__doc__}, @@ -7501,13 +7501,13 @@ {"strerror", posix_strerror, METH_VARARGS, posix_strerror__doc__}, #endif #ifdef HAVE_FCHDIR - {"fchdir", posix_fchdir, METH_O, posix_fchdir__doc__}, + {"fchdir", posix_fchdir, METH_ARGS, posix_fchdir__doc__, 1, 1}, #endif #ifdef HAVE_FSYNC - {"fsync", posix_fsync, METH_O, posix_fsync__doc__}, + {"fsync", posix_fsync, METH_ARGS, posix_fsync__doc__, 1, 1}, #endif #ifdef HAVE_FDATASYNC - {"fdatasync", posix_fdatasync, METH_O, posix_fdatasync__doc__}, + {"fdatasync", posix_fdatasync, METH_ARGS, posix_fdatasync__doc__, 1, 1}, #endif #ifdef HAVE_SYS_WAIT_H #ifdef WCOREDUMP @@ -7542,13 +7542,13 @@ {"statvfs", posix_statvfs, METH_VARARGS, posix_statvfs__doc__}, #endif #ifdef HAVE_TMPFILE - {"tmpfile", posix_tmpfile, METH_NOARGS, posix_tmpfile__doc__}, + {"tmpfile", posix_tmpfile, METH_ARGS, posix_tmpfile__doc__, 0, 0}, #endif #ifdef HAVE_TEMPNAM {"tempnam", posix_tempnam, METH_VARARGS, posix_tempnam__doc__}, #endif #ifdef HAVE_TMPNAM - {"tmpnam", posix_tmpnam, METH_NOARGS, posix_tmpnam__doc__}, + {"tmpnam", posix_tmpnam, METH_ARGS, posix_tmpnam__doc__, 0, 0}, #endif #ifdef HAVE_CONFSTR {"confstr", posix_confstr, METH_VARARGS, posix_confstr__doc__}, @@ -7562,12 +7562,12 @@ #ifdef HAVE_PATHCONF {"pathconf", posix_pathconf, METH_VARARGS, posix_pathconf__doc__}, #endif - {"abort", posix_abort, METH_NOARGS, posix_abort__doc__}, + {"abort", posix_abort, METH_ARGS, posix_abort__doc__, 0, 0}, #ifdef MS_WINDOWS {"_getfullpathname", posix__getfullpathname, METH_VARARGS, NULL}, #endif #ifdef HAVE_GETLOADAVG - {"getloadavg", posix_getloadavg, METH_NOARGS, posix_getloadavg__doc__}, + {"getloadavg", posix_getloadavg, METH_ARGS, posix_getloadavg__doc__, 0, 0}, #endif #ifdef MS_WINDOWS {"urandom", win32_urandom, METH_VARARGS, win32_urandom__doc__}, Index: Modules/pwdmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pwdmodule.c,v retrieving revision 1.39 diff -w -u -r1.39 pwdmodule.c --- Modules/pwdmodule.c 20 Jan 2004 21:07:23 -0000 1.39 +++ Modules/pwdmodule.c 24 Jan 2005 23:36:29 -0000 @@ -173,7 +173,7 @@ {"getpwnam", pwd_getpwnam, METH_VARARGS, pwd_getpwnam__doc__}, #ifdef HAVE_GETPWENT {"getpwall", (PyCFunction)pwd_getpwall, - METH_NOARGS, pwd_getpwall__doc__}, + METH_ARGS, pwd_getpwall__doc__, 0, 0}, #endif {NULL, NULL} /* sentinel */ }; Index: Modules/readline.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/readline.c,v retrieving revision 2.79 diff -w -u -r2.79 readline.c --- Modules/readline.c 25 Nov 2004 04:04:20 -0000 2.79 +++ Modules/readline.c 24 Jan 2005 23:36:29 -0000 @@ -531,9 +531,9 @@ static struct PyMethodDef readline_methods[] = { {"parse_and_bind", parse_and_bind, METH_VARARGS, doc_parse_and_bind}, - {"get_line_buffer", get_line_buffer, METH_NOARGS, doc_get_line_buffer}, + {"get_line_buffer", get_line_buffer, METH_ARGS, doc_get_line_buffer, 0, 0}, {"insert_text", insert_text, METH_VARARGS, doc_insert_text}, - {"redisplay", redisplay, METH_NOARGS, doc_redisplay}, + {"redisplay", redisplay, METH_ARGS, doc_redisplay, 0, 0}, {"read_init_file", read_init_file, METH_VARARGS, doc_read_init_file}, {"read_history_file", read_history_file, METH_VARARGS, doc_read_history_file}, @@ -542,15 +542,15 @@ {"get_history_item", get_history_item, METH_VARARGS, doc_get_history_item}, {"get_current_history_length", (PyCFunction)get_current_history_length, - METH_NOARGS, doc_get_current_history_length}, + METH_ARGS, doc_get_current_history_length, 0, 0}, {"set_history_length", set_history_length, METH_VARARGS, set_history_length_doc}, {"get_history_length", get_history_length, - METH_NOARGS, get_history_length_doc}, + METH_ARGS, get_history_length_doc, 0, 0}, {"set_completer", set_completer, METH_VARARGS, doc_set_completer}, - {"get_completer", get_completer, METH_NOARGS, doc_get_completer}, - {"get_begidx", get_begidx, METH_NOARGS, doc_get_begidx}, - {"get_endidx", get_endidx, METH_NOARGS, doc_get_endidx}, + {"get_completer", get_completer, METH_ARGS, doc_get_completer, 0, 0}, + {"get_begidx", get_begidx, METH_ARGS, doc_get_begidx, 0, 0}, + {"get_endidx", get_endidx, METH_ARGS, doc_get_endidx, 0, 0}, {"set_completer_delims", set_completer_delims, METH_VARARGS, doc_set_completer_delims}, @@ -558,7 +558,7 @@ {"remove_history_item", py_remove_history, METH_VARARGS, doc_remove_history}, {"replace_history_item", py_replace_history, METH_VARARGS, doc_replace_history}, {"get_completer_delims", get_completer_delims, - METH_NOARGS, doc_get_completer_delims}, + METH_ARGS, doc_get_completer_delims, 0, 0}, {"set_startup_hook", set_startup_hook, METH_VARARGS, doc_set_startup_hook}, @@ -567,7 +567,7 @@ METH_VARARGS, doc_set_pre_input_hook}, #endif #ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER - {"clear_history", py_clear_history, METH_NOARGS, doc_clear_history}, + {"clear_history", py_clear_history, METH_ARGS, doc_clear_history, 0, 0}, #endif {0, 0} }; Index: Modules/regexmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/regexmodule.c,v retrieving revision 1.50 diff -w -u -r1.50 regexmodule.c --- Modules/regexmodule.c 12 Oct 2003 19:09:37 -0000 1.50 +++ Modules/regexmodule.c 24 Jan 2005 23:36:29 -0000 @@ -638,7 +638,7 @@ {"match", regex_match, METH_VARARGS}, {"search", regex_search, METH_VARARGS}, {"set_syntax", regex_set_syntax, METH_VARARGS}, - {"get_syntax", (PyCFunction)regex_get_syntax, METH_NOARGS}, + {"get_syntax", (PyCFunction)regex_get_syntax, METH_ARGS, NULL, 0, 0}, {NULL, NULL} /* sentinel */ }; Index: Modules/signalmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/signalmodule.c,v retrieving revision 2.76 diff -w -u -r2.76 signalmodule.c --- Modules/signalmodule.c 13 Oct 2004 14:48:50 -0000 2.76 +++ Modules/signalmodule.c 24 Jan 2005 23:36:29 -0000 @@ -273,7 +273,7 @@ {"getsignal", signal_getsignal, METH_VARARGS, getsignal_doc}, #ifdef HAVE_PAUSE {"pause", (PyCFunction)signal_pause, - METH_NOARGS,pause_doc}, + METH_ARGS,pause_doc, 0, 0}, #endif {"default_int_handler", signal_default_int_handler, METH_VARARGS, default_int_handler_doc}, Index: Modules/socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.311 diff -w -u -r1.311 socketmodule.c --- Modules/socketmodule.c 7 Nov 2004 14:24:25 -0000 1.311 +++ Modules/socketmodule.c 24 Jan 2005 23:36:30 -0000 @@ -2363,32 +2363,32 @@ /* List of methods for socket objects */ static PyMethodDef sock_methods[] = { - {"accept", (PyCFunction)sock_accept, METH_NOARGS, - accept_doc}, - {"bind", (PyCFunction)sock_bind, METH_O, - bind_doc}, - {"close", (PyCFunction)sock_close, METH_NOARGS, - close_doc}, - {"connect", (PyCFunction)sock_connect, METH_O, - connect_doc}, - {"connect_ex", (PyCFunction)sock_connect_ex, METH_O, - connect_ex_doc}, + {"accept", (PyCFunction)sock_accept, METH_ARGS, + accept_doc, 0, 0}, + {"bind", (PyCFunction)sock_bind, METH_ARGS, + bind_doc, 1, 1}, + {"close", (PyCFunction)sock_close, METH_ARGS, + close_doc, 0, 0}, + {"connect", (PyCFunction)sock_connect, METH_ARGS, + connect_doc, 1, 1}, + {"connect_ex", (PyCFunction)sock_connect_ex, METH_ARGS, + connect_ex_doc, 1, 1}, #ifndef NO_DUP - {"dup", (PyCFunction)sock_dup, METH_NOARGS, - dup_doc}, + {"dup", (PyCFunction)sock_dup, METH_ARGS, + dup_doc, 0, 0}, #endif - {"fileno", (PyCFunction)sock_fileno, METH_NOARGS, - fileno_doc}, + {"fileno", (PyCFunction)sock_fileno, METH_ARGS, + fileno_doc, 0, 0}, #ifdef HAVE_GETPEERNAME {"getpeername", (PyCFunction)sock_getpeername, - METH_NOARGS, getpeername_doc}, + METH_ARGS, getpeername_doc, 0, 0}, #endif {"getsockname", (PyCFunction)sock_getsockname, - METH_NOARGS, getsockname_doc}, + METH_ARGS, getsockname_doc, 0, 0}, {"getsockopt", (PyCFunction)sock_getsockopt, METH_VARARGS, getsockopt_doc}, - {"listen", (PyCFunction)sock_listen, METH_O, - listen_doc}, + {"listen", (PyCFunction)sock_listen, METH_ARGS, + listen_doc, 1, 1}, #ifndef NO_DUP {"makefile", (PyCFunction)sock_makefile, METH_VARARGS, makefile_doc}, @@ -2403,19 +2403,19 @@ sendall_doc}, {"sendto", (PyCFunction)sock_sendto, METH_VARARGS, sendto_doc}, - {"setblocking", (PyCFunction)sock_setblocking, METH_O, - setblocking_doc}, - {"settimeout", (PyCFunction)sock_settimeout, METH_O, - settimeout_doc}, - {"gettimeout", (PyCFunction)sock_gettimeout, METH_NOARGS, - gettimeout_doc}, + {"setblocking", (PyCFunction)sock_setblocking, METH_ARGS, + setblocking_doc, 1, 1}, + {"settimeout", (PyCFunction)sock_settimeout, METH_ARGS, + settimeout_doc, 1, 1}, + {"gettimeout", (PyCFunction)sock_gettimeout, METH_ARGS, + gettimeout_doc, 0, 0}, {"setsockopt", (PyCFunction)sock_setsockopt, METH_VARARGS, setsockopt_doc}, - {"shutdown", (PyCFunction)sock_shutdown, METH_O, - shutdown_doc}, + {"shutdown", (PyCFunction)sock_shutdown, METH_ARGS, + shutdown_doc, 1, 1}, #ifdef RISCOS - {"sleeptaskw", (PyCFunction)sock_sleeptaskw, METH_O, - sleeptaskw_doc}, + {"sleeptaskw", (PyCFunction)sock_sleeptaskw, METH_ARGS, + sleeptaskw_doc, 1, 1}, #endif {NULL, NULL} /* sentinel */ }; @@ -3656,11 +3656,11 @@ {"ntohs", socket_ntohs, METH_VARARGS, ntohs_doc}, {"ntohl", socket_ntohl, - METH_O, ntohl_doc}, + METH_ARGS, ntohl_doc, 1, 1}, {"htons", socket_htons, METH_VARARGS, htons_doc}, {"htonl", socket_htonl, - METH_O, htonl_doc}, + METH_ARGS, htonl_doc, 1, 1}, {"inet_aton", socket_inet_aton, METH_VARARGS, inet_aton_doc}, {"inet_ntoa", socket_inet_ntoa, @@ -3676,9 +3676,9 @@ {"getnameinfo", socket_getnameinfo, METH_VARARGS, getnameinfo_doc}, {"getdefaulttimeout", (PyCFunction)socket_getdefaulttimeout, - METH_NOARGS, getdefaulttimeout_doc}, + METH_ARGS, getdefaulttimeout_doc, 0, 0}, {"setdefaulttimeout", socket_setdefaulttimeout, - METH_O, setdefaulttimeout_doc}, + METH_ARGS, setdefaulttimeout_doc, 1, 1}, {NULL, NULL} /* Sentinel */ }; Index: Modules/spwdmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/spwdmodule.c,v retrieving revision 1.2 diff -w -u -r1.2 spwdmodule.c --- Modules/spwdmodule.c 24 Jan 2005 23:33:51 -0000 1.2 +++ Modules/spwdmodule.c 24 Jan 2005 23:36:30 -0000 @@ -160,7 +160,7 @@ {"getspnam", spwd_getspnam, METH_VARARGS, spwd_getspnam__doc__}, #endif #ifdef HAVE_GETSPENT - {"getspall", spwd_getspall, METH_NOARGS, spwd_getspall__doc__}, + {"getspall", spwd_getspall, METH_ARGS, spwd_getspall__doc__, 0, 0}, #endif {NULL, NULL} /* sentinel */ }; Index: Modules/stropmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/stropmodule.c,v retrieving revision 2.91 diff -w -u -r2.91 stropmodule.c --- Modules/stropmodule.c 8 Jun 2004 18:52:53 -0000 2.91 +++ Modules/stropmodule.c 24 Jan 2005 23:36:30 -0000 @@ -1180,24 +1180,24 @@ {"atof", strop_atof, METH_VARARGS, atof__doc__}, {"atoi", strop_atoi, METH_VARARGS, atoi__doc__}, {"atol", strop_atol, METH_VARARGS, atol__doc__}, - {"capitalize", strop_capitalize, METH_O, capitalize__doc__}, + {"capitalize", strop_capitalize, METH_ARGS, capitalize__doc__, 1, 1}, {"count", strop_count, METH_VARARGS, count__doc__}, {"expandtabs", strop_expandtabs, METH_VARARGS, expandtabs__doc__}, {"find", strop_find, METH_VARARGS, find__doc__}, {"join", strop_joinfields, METH_VARARGS, joinfields__doc__}, {"joinfields", strop_joinfields, METH_VARARGS, joinfields__doc__}, - {"lstrip", strop_lstrip, METH_O, lstrip__doc__}, - {"lower", strop_lower, METH_O, lower__doc__}, + {"lstrip", strop_lstrip, METH_ARGS, lstrip__doc__, 1, 1}, + {"lower", strop_lower, METH_ARGS, lower__doc__, 1, 1}, {"maketrans", strop_maketrans, METH_VARARGS, maketrans__doc__}, {"replace", strop_replace, METH_VARARGS, replace__doc__}, {"rfind", strop_rfind, METH_VARARGS, rfind__doc__}, - {"rstrip", strop_rstrip, METH_O, rstrip__doc__}, + {"rstrip", strop_rstrip, METH_ARGS, rstrip__doc__, 1, 1}, {"split", strop_splitfields, METH_VARARGS, splitfields__doc__}, {"splitfields", strop_splitfields, METH_VARARGS, splitfields__doc__}, - {"strip", strop_strip, METH_O, strip__doc__}, - {"swapcase", strop_swapcase, METH_O, swapcase__doc__}, + {"strip", strop_strip, METH_ARGS, strip__doc__, 1, 1}, + {"swapcase", strop_swapcase, METH_ARGS, swapcase__doc__, 1, 1}, {"translate", strop_translate, METH_VARARGS, translate__doc__}, - {"upper", strop_upper, METH_O, upper__doc__}, + {"upper", strop_upper, METH_ARGS, upper__doc__, 1, 1}, {NULL, NULL} /* sentinel */ }; Index: Modules/sunaudiodev.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/sunaudiodev.c,v retrieving revision 1.30 diff -w -u -r1.30 sunaudiodev.c --- Modules/sunaudiodev.c 17 Jul 2002 16:30:37 -0000 1.30 +++ Modules/sunaudiodev.c 24 Jan 2005 23:36:30 -0000 @@ -305,18 +305,18 @@ static PyMethodDef sad_methods[] = { { "read", (PyCFunction)sad_read, METH_VARARGS }, { "write", (PyCFunction)sad_write, METH_VARARGS }, - { "ibufcount", (PyCFunction)sad_ibufcount, METH_NOARGS }, - { "obufcount", (PyCFunction)sad_obufcount, METH_NOARGS }, + { "ibufcount", (PyCFunction)sad_ibufcount, METH_ARGS, NULL, 0, 0 }, + { "obufcount", (PyCFunction)sad_obufcount, METH_ARGS, NULL, 0, 0 }, #define CTL_METHODS 4 - { "getinfo", (PyCFunction)sad_getinfo, METH_NOARGS }, - { "setinfo", (PyCFunction)sad_setinfo, METH_O}, - { "drain", (PyCFunction)sad_drain, METH_NOARGS }, - { "flush", (PyCFunction)sad_flush, METH_NOARGS }, + { "getinfo", (PyCFunction)sad_getinfo, METH_ARGS, NULL, 0, 0 }, + { "setinfo", (PyCFunction)sad_setinfo, METH_ARGS, NULL, 1, 1}, + { "drain", (PyCFunction)sad_drain, METH_ARGS, NULL, 0, 0 }, + { "flush", (PyCFunction)sad_flush, METH_ARGS, NULL, 0, 0 }, #ifdef SOLARIS - { "getdev", (PyCFunction)sad_getdev, METH_NOARGS }, + { "getdev", (PyCFunction)sad_getdev, METH_ARGS, NULL, 0, 0 }, #endif - { "close", (PyCFunction)sad_close, METH_NOARGS }, - { "fileno", (PyCFunction)sad_fileno, METH_NOARGS }, + { "close", (PyCFunction)sad_close, METH_ARGS, NULL, 0, 0 }, + { "fileno", (PyCFunction)sad_fileno, METH_ARGS, NULL, 0, 0 }, {NULL, NULL} /* sentinel */ }; Index: Modules/threadmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/threadmodule.c,v retrieving revision 2.59 diff -w -u -r2.59 threadmodule.c --- Modules/threadmodule.c 24 Aug 2004 22:24:08 -0000 2.59 +++ Modules/threadmodule.c 24 Jan 2005 23:36:30 -0000 @@ -127,13 +127,13 @@ {"acquire", (PyCFunction)lock_PyThread_acquire_lock, METH_VARARGS, acquire_doc}, {"release_lock", (PyCFunction)lock_PyThread_release_lock, - METH_NOARGS, release_doc}, + METH_ARGS, release_doc, 0, 0}, {"release", (PyCFunction)lock_PyThread_release_lock, - METH_NOARGS, release_doc}, + METH_ARGS, release_doc, 0, 0}, {"locked_lock", (PyCFunction)lock_locked_lock, - METH_NOARGS, locked_doc}, + METH_ARGS, locked_doc, 0, 0}, {"locked", (PyCFunction)lock_locked_lock, - METH_NOARGS, locked_doc}, + METH_ARGS, locked_doc, 0, 0}, {NULL, NULL} /* sentinel */ }; @@ -599,17 +599,17 @@ METH_VARARGS, start_new_doc}, {"allocate_lock", (PyCFunction)thread_PyThread_allocate_lock, - METH_NOARGS, allocate_doc}, + METH_ARGS, allocate_doc, 0, 0}, {"allocate", (PyCFunction)thread_PyThread_allocate_lock, - METH_NOARGS, allocate_doc}, + METH_ARGS, allocate_doc, 0, 0}, {"exit_thread", (PyCFunction)thread_PyThread_exit_thread, - METH_NOARGS, exit_doc}, + METH_ARGS, exit_doc, 0, 0}, {"exit", (PyCFunction)thread_PyThread_exit_thread, - METH_NOARGS, exit_doc}, + METH_ARGS, exit_doc, 0, 0}, {"interrupt_main", (PyCFunction)thread_PyThread_interrupt_main, - METH_NOARGS, interrupt_doc}, + METH_ARGS, interrupt_doc, 0, 0}, {"get_ident", (PyCFunction)thread_get_ident, - METH_NOARGS, get_ident_doc}, + METH_ARGS, get_ident_doc, 0, 0}, #ifndef NO_EXIT_PROG {"exit_prog", (PyCFunction)thread_PyThread_exit_prog, METH_VARARGS}, Index: Modules/timingmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/timingmodule.c,v retrieving revision 2.11 diff -w -u -r2.11 timingmodule.c --- Modules/timingmodule.c 2 Aug 2002 02:27:13 -0000 2.11 +++ Modules/timingmodule.c 24 Jan 2005 23:36:30 -0000 @@ -43,11 +43,11 @@ static PyMethodDef timing_methods[] = { - {"start", (PyCFunction)start_timing, METH_NOARGS}, - {"finish", (PyCFunction)finish_timing, METH_NOARGS}, - {"seconds", (PyCFunction)seconds, METH_NOARGS}, - {"milli", (PyCFunction)milli, METH_NOARGS}, - {"micro", (PyCFunction)micro, METH_NOARGS}, + {"start", (PyCFunction)start_timing, METH_ARGS, NULL, 0, 0}, + {"finish", (PyCFunction)finish_timing, METH_ARGS, NULL, 0, 0}, + {"seconds", (PyCFunction)seconds, METH_ARGS, NULL, 0, 0}, + {"milli", (PyCFunction)milli, METH_ARGS, NULL, 0, 0}, + {"micro", (PyCFunction)micro, METH_ARGS, NULL, 0, 0}, {NULL, NULL} };