[Python-checkins] CVS: python/dist/src/Objects complexobject.c,2.37,2.38 descrobject.c,2.2,2.3 dictobject.c,2.108,2.109 fileobject.c,2.117,2.118 iterobject.c,1.6,1.7 listobject.c,2.98,2.99 methodobject.c,2.36,2.37 rangeobject.c,2.27,2.28 stringobject.c,2.122,2.123 typeobject.c,2.35,2.36 unicodeobject.c,2.107,2.108

Martin v. L?wis loewis@users.sourceforge.net
2001年8月16日 06:15:02 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv23257/Objects
Modified Files:
	complexobject.c descrobject.c dictobject.c fileobject.c 
	iterobject.c listobject.c methodobject.c rangeobject.c 
	stringobject.c typeobject.c unicodeobject.c 
Log Message:
Patch #427190: Implement and use METH_NOARGS and METH_O.
Index: complexobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/complexobject.c,v
retrieving revision 2.37
retrieving revision 2.38
diff -C2 -d -r2.37 -r2.38
*** complexobject.c	2001年08月08日 05:00:18	2.37
--- complexobject.c	2001年08月16日 13:15:00	2.38
***************
*** 581,589 ****
 
 static PyObject *
! complex_conjugate(PyObject *self, PyObject *args)
 {
 	Py_complex c;
- 	if (!PyArg_ParseTuple(args, ":conjugate"))
- 		return NULL;
 	c = ((PyComplexObject *)self)->cval;
 	c.imag = -c.imag;
--- 581,587 ----
 
 static PyObject *
! complex_conjugate(PyObject *self)
 {
 	Py_complex c;
 	c = ((PyComplexObject *)self)->cval;
 	c.imag = -c.imag;
***************
*** 592,596 ****
 
 static PyMethodDef complex_methods[] = {
! 	{"conjugate",	complex_conjugate,	1},
 	{NULL,		NULL}		/* sentinel */
 };
--- 590,594 ----
 
 static PyMethodDef complex_methods[] = {
! 	{"conjugate",	(PyCFunction)complex_conjugate,	METH_NOARGS},
 	{NULL,		NULL}		/* sentinel */
 };
Index: descrobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/descrobject.c,v
retrieving revision 2.2
retrieving revision 2.3
diff -C2 -d -r2.2 -r2.3
*** descrobject.c	2001年08月16日 08:27:33	2.2
--- descrobject.c	2001年08月16日 13:15:00	2.3
***************
*** 602,611 ****
 
 static PyObject *
! proxy_has_key(proxyobject *pp, PyObject *args)
 {
- 	PyObject *key;
- 
- 	if (!PyArg_ParseTuple(args, "O:has_key", &key))
- 		return NULL;
 	return PyInt_FromLong(PySequence_Contains(pp->dict, key));
 }
--- 602,607 ----
 
 static PyObject *
! proxy_has_key(proxyobject *pp, PyObject *key)
 {
 	return PyInt_FromLong(PySequence_Contains(pp->dict, key));
 }
***************
*** 622,663 ****
 
 static PyObject *
! proxy_keys(proxyobject *pp, PyObject *args)
 {
- 	if (!PyArg_ParseTuple(args, ":keys"))
- 		return NULL;
 	return PyMapping_Keys(pp->dict);
 }
 
 static PyObject *
! proxy_values(proxyobject *pp, PyObject *args)
 {
- 	if (!PyArg_ParseTuple(args, ":values"))
- 		return NULL;
 	return PyMapping_Values(pp->dict);
 }
 
 static PyObject *
! proxy_items(proxyobject *pp, PyObject *args)
 {
- 	if (!PyArg_ParseTuple(args, ":items"))
- 		return NULL;
 	return PyMapping_Items(pp->dict);
 }
 
 static PyObject *
! proxy_copy(proxyobject *pp, PyObject *args)
 {
- 	if (!PyArg_ParseTuple(args, ":copy"))
- 		return NULL;
 	return PyObject_CallMethod(pp->dict, "copy", NULL);
 }
 
 static PyMethodDef proxy_methods[] = {
! 	{"has_key", (PyCFunction)proxy_has_key, METH_VARARGS, "XXX"},
 	{"get",	 (PyCFunction)proxy_get, METH_VARARGS, "XXX"},
! 	{"keys", (PyCFunction)proxy_keys, METH_VARARGS, "XXX"},
! 	{"values", (PyCFunction)proxy_values, METH_VARARGS, "XXX"},
! 	{"items", (PyCFunction)proxy_items, METH_VARARGS, "XXX"},
! 	{"copy", (PyCFunction)proxy_copy, METH_VARARGS, "XXX"},
 	{0}
 };
--- 618,651 ----
 
 static PyObject *
! proxy_keys(proxyobject *pp)
 {
 	return PyMapping_Keys(pp->dict);
 }
 
 static PyObject *
! proxy_values(proxyobject *pp)
 {
 	return PyMapping_Values(pp->dict);
 }
 
 static PyObject *
! proxy_items(proxyobject *pp)
 {
 	return PyMapping_Items(pp->dict);
 }
 
 static PyObject *
! proxy_copy(proxyobject *pp)
 {
 	return PyObject_CallMethod(pp->dict, "copy", NULL);
 }
 
 static PyMethodDef proxy_methods[] = {
! 	{"has_key", (PyCFunction)proxy_has_key, METH_O, "XXX"},
 	{"get",	 (PyCFunction)proxy_get, METH_VARARGS, "XXX"},
! 	{"keys", (PyCFunction)proxy_keys, METH_NOARGS, "XXX"},
! 	{"values", (PyCFunction)proxy_values, METH_NOARGS, "XXX"},
! 	{"items", (PyCFunction)proxy_items, METH_NOARGS, "XXX"},
! 	{"copy", (PyCFunction)proxy_copy, METH_NOARGS, "XXX"},
 	{0}
 };
Index: dictobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/dictobject.c,v
retrieving revision 2.108
retrieving revision 2.109
diff -C2 -d -r2.108 -r2.109
*** dictobject.c	2001年08月10日 20:28:28	2.108
--- dictobject.c	2001年08月16日 13:15:00	2.109
***************
*** 876,886 ****
 
 static PyObject *
! dict_keys(register dictobject *mp, PyObject *args)
 {
 	register PyObject *v;
 	register int i, j, n;
 
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
 again:
 	n = mp->ma_used;
--- 876,884 ----
 
 static PyObject *
! dict_keys(register dictobject *mp)
 {
 	register PyObject *v;
 	register int i, j, n;
 
 again:
 	n = mp->ma_used;
***************
*** 907,917 ****
 
 static PyObject *
! dict_values(register dictobject *mp, PyObject *args)
 {
 	register PyObject *v;
 	register int i, j, n;
 
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
 again:
 	n = mp->ma_used;
--- 905,913 ----
 
 static PyObject *
! dict_values(register dictobject *mp)
 {
 	register PyObject *v;
 	register int i, j, n;
 
 again:
 	n = mp->ma_used;
***************
*** 938,942 ****
 
 static PyObject *
! dict_items(register dictobject *mp, PyObject *args)
 {
 	register PyObject *v;
--- 934,938 ----
 
 static PyObject *
! dict_items(register dictobject *mp)
 {
 	register PyObject *v;
***************
*** 944,949 ****
 	PyObject *item, *key, *value;
 
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
 	/* Preallocate the list of tuples, to avoid allocations during
 	 * the loop over the items, which could trigger GC, which
--- 940,943 ----
***************
*** 988,997 ****
 
 static PyObject *
! dict_update(PyObject *mp, PyObject *args)
 {
- 	PyObject *other;
- 
- 	if (!PyArg_ParseTuple(args, "O:update", &other))
- 		return NULL;
 	if (PyDict_Update(mp, other) < 0)
 		return NULL;
--- 982,987 ----
 
 static PyObject *
! dict_update(PyObject *mp, PyObject *other)
 {
 	if (PyDict_Update(mp, other) < 0)
 		return NULL;
***************
*** 1100,1107 ****
 
 static PyObject *
! dict_copy(register dictobject *mp, PyObject *args)
 {
- 	if (!PyArg_Parse(args, ""))
- 		return NULL;
 	return PyDict_Copy((PyObject*)mp);
 }
--- 1090,1095 ----
 
 static PyObject *
! dict_copy(register dictobject *mp)
 {
 	return PyDict_Copy((PyObject*)mp);
 }
***************
*** 1156,1160 ****
 		return NULL;
 	}
! 	return dict_keys((dictobject *)mp, (PyObject *)NULL);
 }
 
--- 1144,1148 ----
 		return NULL;
 	}
! 	return dict_keys((dictobject *)mp);
 }
 
***************
*** 1166,1170 ****
 		return NULL;
 	}
! 	return dict_values((dictobject *)mp, (PyObject *)NULL);
 }
 
--- 1154,1158 ----
 		return NULL;
 	}
! 	return dict_values((dictobject *)mp);
 }
 
***************
*** 1176,1180 ****
 		return NULL;
 	}
! 	return dict_items((dictobject *)mp, (PyObject *)NULL);
 }
 
--- 1164,1168 ----
 		return NULL;
 	}
! 	return dict_items((dictobject *)mp);
 }
 
***************
*** 1367,1377 ****
 
 static PyObject *
! dict_has_key(register dictobject *mp, PyObject *args)
 {
- 	PyObject *key;
 	long hash;
 	register long ok;
- 	if (!PyArg_ParseTuple(args, "O:has_key", &key))
- 		return NULL;
 #ifdef CACHE_HASH
 	if (!PyString_Check(key) ||
--- 1355,1362 ----
 
 static PyObject *
! dict_has_key(register dictobject *mp, PyObject *key)
 {
 	long hash;
 	register long ok;
 #ifdef CACHE_HASH
 	if (!PyString_Check(key) ||
***************
*** 1448,1455 ****
 
 static PyObject *
! dict_clear(register dictobject *mp, PyObject *args)
 {
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
 	PyDict_Clear((PyObject *)mp);
 	Py_INCREF(Py_None);
--- 1433,1438 ----
 
 static PyObject *
! dict_clear(register dictobject *mp)
 {
 	PyDict_Clear((PyObject *)mp);
 	Py_INCREF(Py_None);
***************
*** 1458,1462 ****
 
 static PyObject *
! dict_popitem(dictobject *mp, PyObject *args)
 {
 	int i = 0;
--- 1441,1445 ----
 
 static PyObject *
! dict_popitem(dictobject *mp)
 {
 	int i = 0;
***************
*** 1464,1469 ****
 	PyObject *res;
 
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
 	/* Allocate the result tuple before checking the size. Believe it
 	 * or not, this allocation could trigger a garbage collection which
--- 1447,1450 ----
***************
*** 1574,1597 ****
 
 static PyObject *
! dict_iterkeys(dictobject *dict, PyObject *args)
 {
- 	if (!PyArg_ParseTuple(args, ""))
- 		return NULL;
 	return dictiter_new(dict, select_key);
 }
 
 static PyObject *
! dict_itervalues(dictobject *dict, PyObject *args)
 {
- 	if (!PyArg_ParseTuple(args, ""))
- 		return NULL;
 	return dictiter_new(dict, select_value);
 }
 
 static PyObject *
! dict_iteritems(dictobject *dict, PyObject *args)
 {
- 	if (!PyArg_ParseTuple(args, ""))
- 		return NULL;
 	return dictiter_new(dict, select_item);
 }
--- 1555,1572 ----
 
 static PyObject *
! dict_iterkeys(dictobject *dict)
 {
 	return dictiter_new(dict, select_key);
 }
 
 static PyObject *
! dict_itervalues(dictobject *dict)
 {
 	return dictiter_new(dict, select_value);
 }
 
 static PyObject *
! dict_iteritems(dictobject *dict)
 {
 	return dictiter_new(dict, select_item);
 }
***************
*** 1639,1643 ****
 
 static PyMethodDef mapp_methods[] = {
! 	{"has_key",	(PyCFunction)dict_has_key, METH_VARARGS,
 	 has_key__doc__},
 	{"get", (PyCFunction)dict_get, METH_VARARGS,
--- 1614,1618 ----
 
 static PyMethodDef mapp_methods[] = {
! 	{"has_key",	(PyCFunction)dict_has_key, METH_O,
 	 has_key__doc__},
 	{"get", (PyCFunction)dict_get, METH_VARARGS,
***************
*** 1645,1667 ****
 	{"setdefault", (PyCFunction)dict_setdefault, METH_VARARGS,
 	 setdefault_doc__},
! 	{"popitem",	(PyCFunction)dict_popitem,	METH_OLDARGS,
 	 popitem__doc__},
! 	{"keys",	(PyCFunction)dict_keys,		METH_OLDARGS,
 	keys__doc__},
! 	{"items",	(PyCFunction)dict_items,	METH_OLDARGS,
 	 items__doc__},
! 	{"values",	(PyCFunction)dict_values,	METH_OLDARGS,
 	 values__doc__},
! 	{"update",	(PyCFunction)dict_update,	METH_VARARGS,
 	 update__doc__},
! 	{"clear",	(PyCFunction)dict_clear,	METH_OLDARGS,
 	 clear__doc__},
! 	{"copy",	(PyCFunction)dict_copy,		METH_OLDARGS,
 	 copy__doc__},
! 	{"iterkeys",	(PyCFunction)dict_iterkeys,	METH_VARARGS,
 	 iterkeys__doc__},
! 	{"itervalues",	(PyCFunction)dict_itervalues,	METH_VARARGS,
 	 itervalues__doc__},
! 	{"iteritems",	(PyCFunction)dict_iteritems,	METH_VARARGS,
 	 iteritems__doc__},
 	{NULL,		NULL}	/* sentinel */
--- 1620,1642 ----
 	{"setdefault", (PyCFunction)dict_setdefault, METH_VARARGS,
 	 setdefault_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__},
! 	{"update",	(PyCFunction)dict_update,	METH_O,
 	 update__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__},
 	{NULL,		NULL}	/* sentinel */
Index: fileobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v
retrieving revision 2.117
retrieving revision 2.118
diff -C2 -d -r2.117 -r2.118
*** fileobject.c	2001年08月09日 18:14:59	2.117
--- fileobject.c	2001年08月16日 13:15:00	2.118
***************
*** 190,198 ****
 
 static PyObject *
! file_close(PyFileObject *f, PyObject *args)
 {
 	int sts = 0;
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
 	if (f->f_fp != NULL) {
 		if (f->f_close != NULL) {
--- 190,196 ----
 
 static PyObject *
! file_close(PyFileObject *f)
 {
 	int sts = 0;
 	if (f->f_fp != NULL) {
 		if (f->f_close != NULL) {
***************
*** 387,391 ****
 
 static PyObject *
! file_tell(PyFileObject *f, PyObject *args)
 {
 	Py_off_t pos;
--- 385,389 ----
 
 static PyObject *
! file_tell(PyFileObject *f)
 {
 	Py_off_t pos;
***************
*** 393,398 ****
 	if (f->f_fp == NULL)
 		return err_closed();
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
 	Py_BEGIN_ALLOW_THREADS
 	errno = 0;
--- 391,394 ----
***************
*** 412,426 ****
 
 static PyObject *
! file_fileno(PyFileObject *f, PyObject *args)
 {
 	if (f->f_fp == NULL)
 		return err_closed();
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
 	return PyInt_FromLong((long) fileno(f->f_fp));
 }
 
 static PyObject *
! file_flush(PyFileObject *f, PyObject *args)
 {
 	int res;
--- 408,420 ----
 
 static PyObject *
! file_fileno(PyFileObject *f)
 {
 	if (f->f_fp == NULL)
 		return err_closed();
 	return PyInt_FromLong((long) fileno(f->f_fp));
 }
 
 static PyObject *
! file_flush(PyFileObject *f)
 {
 	int res;
***************
*** 428,433 ****
 	if (f->f_fp == NULL)
 		return err_closed();
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
 	Py_BEGIN_ALLOW_THREADS
 	errno = 0;
--- 422,425 ----
***************
*** 444,454 ****
 
 static PyObject *
! file_isatty(PyFileObject *f, PyObject *args)
 {
 	long res;
 	if (f->f_fp == NULL)
 		return err_closed();
- 	if (!PyArg_NoArgs(args))
- 		return NULL;
 	Py_BEGIN_ALLOW_THREADS
 	res = isatty((int)fileno(f->f_fp));
--- 436,444 ----
 
 static PyObject *
! file_isatty(PyFileObject *f)
 {
 	long res;
 	if (f->f_fp == NULL)
 		return err_closed();
 	Py_BEGIN_ALLOW_THREADS
 	res = isatty((int)fileno(f->f_fp));
***************
*** 969,979 ****
 
 static PyObject *
! file_xreadlines(PyFileObject *f, PyObject *args)
 {
 	static PyObject* xreadlines_function = NULL;
 
- 	if (!PyArg_ParseTuple(args, ":xreadlines"))
- 		return NULL;
- 
 	if (!xreadlines_function) {
 		PyObject *xreadlines_module =
--- 959,966 ----
 
 static PyObject *
! file_xreadlines(PyFileObject *f)
 {
 	static PyObject* xreadlines_function = NULL;
 
 	if (!xreadlines_function) {
 		PyObject *xreadlines_module =
***************
*** 1249,1268 ****
 
 static PyMethodDef file_methods[] = {
! 	{"readline",	(PyCFunction)file_readline, 1},
! 	{"read",	(PyCFunction)file_read, 1},
! 	{"write",	(PyCFunction)file_write, 0},
! 	{"fileno",	(PyCFunction)file_fileno, 0},
! 	{"seek",	(PyCFunction)file_seek, 1},
 #ifdef HAVE_FTRUNCATE
! 	{"truncate",	(PyCFunction)file_truncate, 1},
 #endif
! 	{"tell",	(PyCFunction)file_tell, 0},
! 	{"readinto",	(PyCFunction)file_readinto, 0},
! 	{"readlines",	(PyCFunction)file_readlines, 1},
! 	{"xreadlines",	(PyCFunction)file_xreadlines, 1},
! 	{"writelines",	(PyCFunction)file_writelines, 0},
! 	{"flush",	(PyCFunction)file_flush, 0},
! 	{"close",	(PyCFunction)file_close, 0},
! 	{"isatty",	(PyCFunction)file_isatty, 0},
 	{NULL,		NULL}		/* sentinel */
 };
--- 1236,1255 ----
 
 static PyMethodDef file_methods[] = {
! 	{"readline",	(PyCFunction)file_readline, METH_VARARGS},
! 	{"read",	(PyCFunction)file_read, METH_VARARGS},
! 	{"write",	(PyCFunction)file_write, METH_OLDARGS},
! 	{"fileno",	(PyCFunction)file_fileno, METH_NOARGS},
! 	{"seek",	(PyCFunction)file_seek, METH_VARARGS},
 #ifdef HAVE_FTRUNCATE
! 	{"truncate",	(PyCFunction)file_truncate, METH_VARARGS},
 #endif
! 	{"tell",	(PyCFunction)file_tell, METH_NOARGS},
! 	{"readinto",	(PyCFunction)file_readinto, METH_OLDARGS},
! 	{"readlines",	(PyCFunction)file_readlines, METH_VARARGS},
! 	{"xreadlines",	(PyCFunction)file_xreadlines, METH_NOARGS},
! 	{"writelines",	(PyCFunction)file_writelines, METH_O},
! 	{"flush",	(PyCFunction)file_flush, METH_NOARGS},
! 	{"close",	(PyCFunction)file_close, METH_NOARGS},
! 	{"isatty",	(PyCFunction)file_isatty, METH_NOARGS},
 	{NULL,		NULL}		/* sentinel */
 };
Index: iterobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/iterobject.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** iterobject.c	2001年08月02日 04:15:00	1.6
--- iterobject.c	2001年08月16日 13:15:00	1.7
***************
*** 38,42 ****
 
 static PyObject *
! iter_next(seqiterobject *it, PyObject *args)
 {
 	PyObject *seq = it->it_seq;
--- 38,42 ----
 
 static PyObject *
! iter_next(seqiterobject *it)
 {
 	PyObject *seq = it->it_seq;
***************
*** 92,96 ****
 
 static PyMethodDef iter_methods[] = {
! 	{"next",	(PyCFunction)iter_next,	METH_VARARGS,
 	 "it.next() -- get the next value, or raise StopIteration"},
 	{NULL,		NULL}		/* sentinel */
--- 92,96 ----
 
 static PyMethodDef iter_methods[] = {
! 	{"next",	(PyCFunction)iter_next,	METH_NOARGS,
 	 "it.next() -- get the next value, or raise StopIteration"},
 	{NULL,		NULL}		/* sentinel */
Index: listobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v
retrieving revision 2.98
retrieving revision 2.99
diff -C2 -d -r2.98 -r2.99
*** listobject.c	2001年08月02日 04:15:00	2.98
--- listobject.c	2001年08月16日 13:15:00	2.99
***************
*** 624,632 ****
 
 static PyObject *
! listappend(PyListObject *self, PyObject *args)
 {
- 	PyObject *v;
- 	if (!PyArg_ParseTuple(args, "O:append", &v))
- 		return NULL;
 	return ins(self, (int) self->ob_size, v);
 }
--- 624,629 ----
 
 static PyObject *
! listappend(PyListObject *self, PyObject *v)
 {
 	return ins(self, (int) self->ob_size, v);
 }
***************
*** 703,714 ****
 
 static PyObject *
! listextend(PyListObject *self, PyObject *args)
 {
 
- 	PyObject *b;
- 	
- 	if (!PyArg_ParseTuple(args, "O:extend", &b))
- 		return NULL;
- 
 	b = PySequence_Fast(b, "list.extend() argument must be iterable");
 	if (!b)
--- 700,706 ----
 
 static PyObject *
! listextend(PyListObject *self, PyObject *b)
 {
 
 	b = PySequence_Fast(b, "list.extend() argument must be iterable");
 	if (!b)
***************
*** 1345,1352 ****
 
 static PyObject *
! listreverse(PyListObject *self, PyObject *args)
 {
- 	if (!PyArg_ParseTuple(args, ":reverse"))
- 		return NULL;
 	_listreverse(self);
 	Py_INCREF(Py_None);
--- 1337,1342 ----
 
 static PyObject *
! listreverse(PyListObject *self)
 {
 	_listreverse(self);
 	Py_INCREF(Py_None);
***************
*** 1391,1401 ****
 
 static PyObject *
! listindex(PyListObject *self, PyObject *args)
 {
 	int i;
- 	PyObject *v;
 
- 	if (!PyArg_ParseTuple(args, "O:index", &v))
- 		return NULL;
 	for (i = 0; i < self->ob_size; i++) {
 		int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ);
--- 1381,1388 ----
 
 static PyObject *
! listindex(PyListObject *self, PyObject *v)
 {
 	int i;
 
 	for (i = 0; i < self->ob_size; i++) {
 		int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ);
***************
*** 1410,1421 ****
 
 static PyObject *
! listcount(PyListObject *self, PyObject *args)
 {
 	int count = 0;
 	int i;
- 	PyObject *v;
 
- 	if (!PyArg_ParseTuple(args, "O:count", &v))
- 		return NULL;
 	for (i = 0; i < self->ob_size; i++) {
 		int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ);
--- 1397,1405 ----
 
 static PyObject *
! listcount(PyListObject *self, PyObject *v)
 {
 	int count = 0;
 	int i;
 
 	for (i = 0; i < self->ob_size; i++) {
 		int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ);
***************
*** 1429,1439 ****
 
 static PyObject *
! listremove(PyListObject *self, PyObject *args)
 {
 	int i;
- 	PyObject *v;
 
- 	if (!PyArg_ParseTuple(args, "O:remove", &v))
- 		return NULL;
 	for (i = 0; i < self->ob_size; i++) {
 		int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ);
--- 1413,1420 ----
 
 static PyObject *
! listremove(PyListObject *self, PyObject *v)
 {
 	int i;
 
 	for (i = 0; i < self->ob_size; i++) {
 		int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ);
***************
*** 1662,1673 ****
 
 static PyMethodDef list_methods[] = {
! 	{"append",	(PyCFunction)listappend, METH_VARARGS, append_doc},
 	{"insert",	(PyCFunction)listinsert, METH_VARARGS, insert_doc},
! 	{"extend", (PyCFunction)listextend, METH_VARARGS, extend_doc},
 	{"pop",		(PyCFunction)listpop, 	 METH_VARARGS, pop_doc},
! 	{"remove",	(PyCFunction)listremove, METH_VARARGS, remove_doc},
! 	{"index",	(PyCFunction)listindex, METH_VARARGS, index_doc},
! 	{"count",	(PyCFunction)listcount, METH_VARARGS, count_doc},
! 	{"reverse",	(PyCFunction)listreverse, METH_VARARGS, reverse_doc},
 	{"sort",	(PyCFunction)listsort, 	 METH_VARARGS, sort_doc},
 	{NULL,		NULL}		/* sentinel */
--- 1643,1654 ----
 
 static PyMethodDef list_methods[] = {
! 	{"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},
! 	{"index",	(PyCFunction)listindex, METH_O, index_doc},
! 	{"count",	(PyCFunction)listcount, METH_O, count_doc},
! 	{"reverse",	(PyCFunction)listreverse, METH_NOARGS, reverse_doc},
 	{"sort",	(PyCFunction)listsort, 	 METH_VARARGS, sort_doc},
 	{NULL,		NULL}		/* sentinel */
***************
*** 1750,1760 ****
 
 static PyMethodDef immutable_list_methods[] = {
! 	{"append",	(PyCFunction)immutable_list_op},
! 	{"insert",	(PyCFunction)immutable_list_op},
! 	{"remove",	(PyCFunction)immutable_list_op},
! 	{"index",	(PyCFunction)listindex},
! 	{"count",	(PyCFunction)listcount},
! 	{"reverse",	(PyCFunction)immutable_list_op},
! 	{"sort",	(PyCFunction)immutable_list_op},
 	{NULL,		NULL}		/* sentinel */
 };
--- 1731,1741 ----
 
 static PyMethodDef immutable_list_methods[] = {
! 	{"append",	(PyCFunction)immutable_list_op, METH_VARARGS},
! 	{"insert",	(PyCFunction)immutable_list_op, METH_VARARGS},
! 	{"remove",	(PyCFunction)immutable_list_op, METH_VARARGS},
! 	{"index",	(PyCFunction)listindex, METH_O},
! 	{"count",	(PyCFunction)listcount, METH_O},
! 	{"reverse",	(PyCFunction)immutable_list_op, METH_VARARGS},
! 	{"sort",	(PyCFunction)immutable_list_op, METH_VARARGS},
 	{NULL,		NULL}		/* sentinel */
 };
Index: methodobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/methodobject.c,v
retrieving revision 2.36
retrieving revision 2.37
diff -C2 -d -r2.36 -r2.37
*** methodobject.c	2001年08月12日 21:51:04	2.36
--- methodobject.c	2001年08月16日 13:15:00	2.37
***************
*** 64,67 ****
--- 64,68 ----
 	PyObject *self = PyCFunction_GET_SELF(func);
 	int flags = PyCFunction_GET_FLAGS(func);
+ 	int size = PyTuple_GET_SIZE(arg);
 
 	if (flags & METH_KEYWORDS) {
***************
*** 74,83 ****
 		return NULL;
 	}
! 	if (flags & METH_VARARGS) {
 		return (*meth)(self, arg);
! 	}
! 	if (!(flags & METH_VARARGS)) {
 		/* the really old style */
- 		int size = PyTuple_GET_SIZE(arg);
 		if (size == 1)
 			arg = PyTuple_GET_ITEM(arg, 0);
--- 75,101 ----
 		return NULL;
 	}
! 
! 	switch (flags) {
! 	case METH_VARARGS:
 		return (*meth)(self, arg);
! 		break;
! 	case METH_NOARGS:
! 		if (size == 0)
! 			return (*meth)(self, NULL);
! 		PyErr_Format(PyExc_TypeError,
! 			 "%.200s() takes no arguments (%d given)",
! 			 f->m_ml->ml_name, size);
! 		return NULL;
! 		break;
! 	case METH_O:
! 		if (size == 1)
! 			return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
! 		PyErr_Format(PyExc_TypeError,
! 			 "%.200s() takes exactly one argument (%d given)",
! 			 f->m_ml->ml_name, size);
! 		return NULL;
! 		break;
! 	case METH_OLDARGS:
 		/* the really old style */
 		if (size == 1)
 			arg = PyTuple_GET_ITEM(arg, 0);
***************
*** 85,92 ****
 			arg = NULL;
 		return (*meth)(self, arg);
 	}
- 	/* should never get here ??? */
- 	PyErr_BadInternalCall();
- 	return NULL;
 }
 
--- 103,111 ----
 			arg = NULL;
 		return (*meth)(self, arg);
+ 	default:
+ 		/* should never get here ??? */
+ 		PyErr_BadInternalCall();
+ 		return NULL;
 	}
 }
 
Index: rangeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/rangeobject.c,v
retrieving revision 2.27
retrieving revision 2.28
diff -C2 -d -r2.27 -r2.28
*** rangeobject.c	2001年08月02日 04:15:00	2.27
--- rangeobject.c	2001年08月16日 13:15:00	2.28
***************
*** 244,250 ****
 	WARN("xrange.tolist() is deprecated; use list(xrange) instead");
 
- 	if (! PyArg_ParseTuple(args, ":tolist"))
- 		return NULL;
- 
 	if (self->totlen == -1)
 		return PyErr_NoMemory();
--- 244,247 ----
***************
*** 267,271 ****
 
 	static PyMethodDef range_methods[] = {
! 		{"tolist",	(PyCFunction)range_tolist, METH_VARARGS,
 "tolist() -> list\n"
 "Return a list object with the same values.\n"
--- 264,268 ----
 
 	static PyMethodDef range_methods[] = {
! 		{"tolist",	(PyCFunction)range_tolist, METH_NOARGS,
 "tolist() -> list\n"
 "Return a list object with the same values.\n"
Index: stringobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v
retrieving revision 2.122
retrieving revision 2.123
diff -C2 -d -r2.122 -r2.123
*** stringobject.c	2001年08月02日 04:15:00	2.122
--- stringobject.c	2001年08月16日 13:15:00	2.123
***************
*** 922,926 ****
 
 static PyObject *
! string_join(PyStringObject *self, PyObject *args)
 {
 	char *sep = PyString_AS_STRING(self);
--- 922,926 ----
 
 static PyObject *
! string_join(PyStringObject *self, PyObject *orig)
 {
 	char *sep = PyString_AS_STRING(self);
***************
*** 931,938 ****
 	size_t sz = 0;
 	int i;
! 	PyObject *orig, *seq, *item;
! 
! 	if (!PyArg_ParseTuple(args, "O:join", &orig))
! 		return NULL;
 
 	seq = PySequence_Fast(orig, "");
--- 931,935 ----
 	size_t sz = 0;
 	int i;
! 	PyObject *seq, *item;
 
 	seq = PySequence_Fast(orig, "");
***************
*** 1030,1046 ****
 _PyString_Join(PyObject *sep, PyObject *x)
 {
- 	PyObject* args;
- 	PyObject* result = NULL;
- 
 	assert(sep != NULL && PyString_Check(sep));
 	assert(x != NULL);
! 	args = PyTuple_New(1);
! 	if (args != NULL) {
! 		Py_INCREF(x);
! 		PyTuple_SET_ITEM(args, 0, x);
! 		result = string_join((PyStringObject *)sep, args);
! 		Py_DECREF(args);
! 	}
! 	return result;
 }
 
--- 1027,1033 ----
 _PyString_Join(PyObject *sep, PyObject *x)
 {
 	assert(sep != NULL && PyString_Check(sep));
 	assert(x != NULL);
! 	return string_join((PyStringObject *)sep, x);
 }
 
***************
*** 1177,1188 ****
 
 static PyObject *
! do_strip(PyStringObject *self, PyObject *args, int striptype)
 {
 	char *s = PyString_AS_STRING(self);
 	int len = PyString_GET_SIZE(self), i, j;
 
- 	if (!PyArg_ParseTuple(args, ":strip"))
- 		return NULL;
- 
 	i = 0;
 	if (striptype != RIGHTSTRIP) {
--- 1164,1172 ----
 
 static PyObject *
! do_strip(PyStringObject *self, int striptype)
 {
 	char *s = PyString_AS_STRING(self);
 	int len = PyString_GET_SIZE(self), i, j;
 
 	i = 0;
 	if (striptype != RIGHTSTRIP) {
***************
*** 1216,1222 ****
 
 static PyObject *
! string_strip(PyStringObject *self, PyObject *args)
 {
! 	return do_strip(self, args, BOTHSTRIP);
 }
 
--- 1200,1206 ----
 
 static PyObject *
! string_strip(PyStringObject *self)
 {
! 	return do_strip(self, BOTHSTRIP);
 }
 
***************
*** 1228,1234 ****
 
 static PyObject *
! string_lstrip(PyStringObject *self, PyObject *args)
 {
! 	return do_strip(self, args, LEFTSTRIP);
 }
 
--- 1212,1218 ----
 
 static PyObject *
! string_lstrip(PyStringObject *self)
 {
! 	return do_strip(self, LEFTSTRIP);
 }
 
***************
*** 1240,1246 ****
 
 static PyObject *
! string_rstrip(PyStringObject *self, PyObject *args)
 {
! 	return do_strip(self, args, RIGHTSTRIP);
 }
 
--- 1224,1230 ----
 
 static PyObject *
! string_rstrip(PyStringObject *self)
 {
! 	return do_strip(self, RIGHTSTRIP);
 }
 
***************
*** 1252,1256 ****
 
 static PyObject *
! string_lower(PyStringObject *self, PyObject *args)
 {
 	char *s = PyString_AS_STRING(self), *s_new;
--- 1236,1240 ----
 
 static PyObject *
! string_lower(PyStringObject *self)
 {
 	char *s = PyString_AS_STRING(self), *s_new;
***************
*** 1258,1263 ****
 	PyObject *new;
 
- 	if (!PyArg_ParseTuple(args, ":lower"))
- 		return NULL;
 	new = PyString_FromStringAndSize(NULL, n);
 	if (new == NULL)
--- 1242,1245 ----
***************
*** 1282,1286 ****
 
 static PyObject *
! string_upper(PyStringObject *self, PyObject *args)
 {
 	char *s = PyString_AS_STRING(self), *s_new;
--- 1264,1268 ----
 
 static PyObject *
! string_upper(PyStringObject *self)
 {
 	char *s = PyString_AS_STRING(self), *s_new;
***************
*** 1288,1293 ****
 	PyObject *new;
 
- 	if (!PyArg_ParseTuple(args, ":upper"))
- 		return NULL;
 	new = PyString_FromStringAndSize(NULL, n);
 	if (new == NULL)
--- 1270,1273 ----
***************
*** 1313,1317 ****
 
 static PyObject*
! string_title(PyStringObject *self, PyObject *args)
 {
 	char *s = PyString_AS_STRING(self), *s_new;
--- 1293,1297 ----
 
 static PyObject*
! string_title(PyStringObject *self)
 {
 	char *s = PyString_AS_STRING(self), *s_new;
***************
*** 1320,1325 ****
 	PyObject *new;
 
- 	if (!PyArg_ParseTuple(args, ":title"))
- 		return NULL;
 	new = PyString_FromStringAndSize(NULL, n);
 	if (new == NULL)
--- 1300,1303 ----
***************
*** 1350,1354 ****
 
 static PyObject *
! string_capitalize(PyStringObject *self, PyObject *args)
 {
 	char *s = PyString_AS_STRING(self), *s_new;
--- 1328,1332 ----
 
 static PyObject *
! string_capitalize(PyStringObject *self)
 {
 	char *s = PyString_AS_STRING(self), *s_new;
***************
*** 1356,1361 ****
 	PyObject *new;
 
- 	if (!PyArg_ParseTuple(args, ":capitalize"))
- 		return NULL;
 	new = PyString_FromStringAndSize(NULL, n);
 	if (new == NULL)
--- 1334,1337 ----
***************
*** 1451,1455 ****
 
 static PyObject *
! string_swapcase(PyStringObject *self, PyObject *args)
 {
 	char *s = PyString_AS_STRING(self), *s_new;
--- 1427,1431 ----
 
 static PyObject *
! string_swapcase(PyStringObject *self)
 {
 	char *s = PyString_AS_STRING(self), *s_new;
***************
*** 1457,1462 ****
 	PyObject *new;
 
- 	if (!PyArg_ParseTuple(args, ":swapcase"))
- 		return NULL;
 	new = PyString_FromStringAndSize(NULL, n);
 	if (new == NULL)
--- 1433,1436 ----
***************
*** 2151,2155 ****
 
 static PyObject*
! string_isspace(PyStringObject *self, PyObject *args)
 {
 register const unsigned char *p
--- 2125,2129 ----
 
 static PyObject*
! string_isspace(PyStringObject *self)
 {
 register const unsigned char *p
***************
*** 2157,2163 ****
 register const unsigned char *e;
 
- if (!PyArg_NoArgs(args))
- return NULL;
- 
 /* Shortcut for single character strings */
 if (PyString_GET_SIZE(self) == 1 &&
--- 2131,2134 ----
***************
*** 2185,2189 ****
 
 static PyObject*
! string_isalpha(PyStringObject *self, PyObject *args)
 {
 register const unsigned char *p
--- 2156,2160 ----
 
 static PyObject*
! string_isalpha(PyStringObject *self)
 {
 register const unsigned char *p
***************
*** 2191,2197 ****
 register const unsigned char *e;
 
- if (!PyArg_NoArgs(args))
- return NULL;
- 
 /* Shortcut for single character strings */
 if (PyString_GET_SIZE(self) == 1 &&
--- 2162,2165 ----
***************
*** 2219,2223 ****
 
 static PyObject*
! string_isalnum(PyStringObject *self, PyObject *args)
 {
 register const unsigned char *p
--- 2187,2191 ----
 
 static PyObject*
! string_isalnum(PyStringObject *self)
 {
 register const unsigned char *p
***************
*** 2225,2231 ****
 register const unsigned char *e;
 
- if (!PyArg_NoArgs(args))
- return NULL;
- 
 /* Shortcut for single character strings */
 if (PyString_GET_SIZE(self) == 1 &&
--- 2193,2196 ----
***************
*** 2253,2257 ****
 
 static PyObject*
! string_isdigit(PyStringObject *self, PyObject *args)
 {
 register const unsigned char *p
--- 2218,2222 ----
 
 static PyObject*
! string_isdigit(PyStringObject *self)
 {
 register const unsigned char *p
***************
*** 2259,2265 ****
 register const unsigned char *e;
 
- if (!PyArg_NoArgs(args))
- return NULL;
- 
 /* Shortcut for single character strings */
 if (PyString_GET_SIZE(self) == 1 &&
--- 2224,2227 ----
***************
*** 2287,2291 ****
 
 static PyObject*
! string_islower(PyStringObject *self, PyObject *args)
 {
 register const unsigned char *p
--- 2249,2253 ----
 
 static PyObject*
! string_islower(PyStringObject *self)
 {
 register const unsigned char *p
***************
*** 2294,2300 ****
 int cased;
 
- if (!PyArg_NoArgs(args))
- return NULL;
- 
 /* Shortcut for single character strings */
 if (PyString_GET_SIZE(self) == 1)
--- 2256,2259 ----
***************
*** 2324,2328 ****
 
 static PyObject*
! string_isupper(PyStringObject *self, PyObject *args)
 {
 register const unsigned char *p
--- 2283,2287 ----
 
 static PyObject*
! string_isupper(PyStringObject *self)
 {
 register const unsigned char *p
***************
*** 2331,2337 ****
 int cased;
 
- if (!PyArg_NoArgs(args))
- return NULL;
- 
 /* Shortcut for single character strings */
 if (PyString_GET_SIZE(self) == 1)
--- 2290,2293 ----
***************
*** 2362,2366 ****
 
 static PyObject*
! string_istitle(PyStringObject *self, PyObject *args)
 {
 register const unsigned char *p
--- 2318,2322 ----
 
 static PyObject*
! string_istitle(PyStringObject *self, PyObject *uncased)
 {
 register const unsigned char *p
***************
*** 2369,2375 ****
 int cased, previous_is_cased;
 
- if (!PyArg_NoArgs(args))
- return NULL;
- 
 /* Shortcut for single character strings */
 if (PyString_GET_SIZE(self) == 1)
--- 2325,2328 ----
***************
*** 2483,2521 ****
 	/* Counterparts of the obsolete stropmodule functions; except
 	 string.maketrans(). */
! 	{"join", (PyCFunction)string_join, 1, join__doc__},
! 	{"split", (PyCFunction)string_split, 1, split__doc__},
! 	{"lower", (PyCFunction)string_lower, 1, lower__doc__},
! 	{"upper", (PyCFunction)string_upper, 1, upper__doc__},
! 	{"islower", (PyCFunction)string_islower, 0, islower__doc__},
! 	{"isupper", (PyCFunction)string_isupper, 0, isupper__doc__},
! 	{"isspace", (PyCFunction)string_isspace, 0, isspace__doc__},
! 	{"isdigit", (PyCFunction)string_isdigit, 0, isdigit__doc__},
! 	{"istitle", (PyCFunction)string_istitle, 0, istitle__doc__},
! 	{"isalpha", (PyCFunction)string_isalpha, 0, isalpha__doc__},
! 	{"isalnum", (PyCFunction)string_isalnum, 0, isalnum__doc__},
! 	{"capitalize", (PyCFunction)string_capitalize, 1, capitalize__doc__},
! 	{"count", (PyCFunction)string_count, 1, count__doc__},
! 	{"endswith", (PyCFunction)string_endswith, 1, endswith__doc__},
! 	{"find", (PyCFunction)string_find, 1, find__doc__},
! 	{"index", (PyCFunction)string_index, 1, index__doc__},
! 	{"lstrip", (PyCFunction)string_lstrip, 1, lstrip__doc__},
! 	{"replace", (PyCFunction)string_replace, 1, replace__doc__},
! 	{"rfind", (PyCFunction)string_rfind, 1, rfind__doc__},
! 	{"rindex", (PyCFunction)string_rindex, 1, rindex__doc__},
! 	{"rstrip", (PyCFunction)string_rstrip, 1, rstrip__doc__},
! 	{"startswith", (PyCFunction)string_startswith, 1, startswith__doc__},
! 	{"strip", (PyCFunction)string_strip, 1, strip__doc__},
! 	{"swapcase", (PyCFunction)string_swapcase, 1, swapcase__doc__},
! 	{"translate", (PyCFunction)string_translate, 1, translate__doc__},
! 	{"title", (PyCFunction)string_title, 1, title__doc__},
! 	{"ljust", (PyCFunction)string_ljust, 1, ljust__doc__},
! 	{"rjust", (PyCFunction)string_rjust, 1, rjust__doc__},
! 	{"center", (PyCFunction)string_center, 1, center__doc__},
! 	{"encode", (PyCFunction)string_encode, 1, encode__doc__},
! 	{"decode", (PyCFunction)string_decode, 1, decode__doc__},
! 	{"expandtabs", (PyCFunction)string_expandtabs, 1, expandtabs__doc__},
! 	{"splitlines", (PyCFunction)string_splitlines, 1, splitlines__doc__},
 #if 0
! 	{"zfill", (PyCFunction)string_zfill, 1, zfill__doc__},
 #endif
 	{NULL, NULL}		 /* sentinel */
--- 2436,2474 ----
 	/* Counterparts of the obsolete stropmodule functions; except
 	 string.maketrans(). */
! 	{"join", (PyCFunction)string_join, METH_O, join__doc__},
! 	{"split", (PyCFunction)string_split, METH_VARARGS, split__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__},
! 	{"count", (PyCFunction)string_count, METH_VARARGS, count__doc__},
! 	{"endswith", (PyCFunction)string_endswith, METH_VARARGS, endswith__doc__},
! 	{"find", (PyCFunction)string_find, METH_VARARGS, find__doc__},
! 	{"index", (PyCFunction)string_index, METH_VARARGS, index__doc__},
! 	{"lstrip", (PyCFunction)string_lstrip, METH_NOARGS, lstrip__doc__},
! 	{"replace", (PyCFunction)string_replace, METH_VARARGS, replace__doc__},
! 	{"rfind", (PyCFunction)string_rfind, METH_VARARGS, rfind__doc__},
! 	{"rindex", (PyCFunction)string_rindex, METH_VARARGS, rindex__doc__},
! 	{"rstrip", (PyCFunction)string_rstrip, METH_NOARGS, rstrip__doc__},
! 	{"startswith", (PyCFunction)string_startswith, METH_VARARGS, startswith__doc__},
! 	{"strip", (PyCFunction)string_strip, METH_NOARGS, 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__},
! 	{"ljust", (PyCFunction)string_ljust, METH_VARARGS, ljust__doc__},
! 	{"rjust", (PyCFunction)string_rjust, METH_VARARGS, rjust__doc__},
! 	{"center", (PyCFunction)string_center, METH_VARARGS, center__doc__},
! 	{"encode", (PyCFunction)string_encode, METH_VARARGS, encode__doc__},
! 	{"decode", (PyCFunction)string_decode, METH_VARARGS, decode__doc__},
! 	{"expandtabs", (PyCFunction)string_expandtabs, METH_VARARGS, expandtabs__doc__},
! 	{"splitlines", (PyCFunction)string_splitlines, METH_VARARGS, splitlines__doc__},
 #if 0
! 	{"zfill", (PyCFunction)string_zfill, METH_VARARGS, zfill__doc__},
 #endif
 	{NULL, NULL}		 /* sentinel */
Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.35
retrieving revision 2.36
diff -C2 -d -r2.35 -r2.36
*** typeobject.c	2001年08月16日 09:18:56	2.35
--- typeobject.c	2001年08月16日 13:15:00	2.36
***************
*** 377,386 ****
 
 static PyObject *
! mro_external(PyObject *self, PyObject *args)
 {
 	PyTypeObject *type = (PyTypeObject *)self;
 
- 	if (!PyArg_ParseTuple(args, ""))
- 		return NULL;
 	return mro_implementation(type);
 }
--- 377,384 ----
 
 static PyObject *
! mro_external(PyObject *self)
 {
 	PyTypeObject *type = (PyTypeObject *)self;
 
 	return mro_implementation(type);
 }
***************
*** 846,850 ****
 
 static PyMethodDef type_methods[] = {
! 	{"mro", mro_external, METH_VARARGS,
 	 "mro() -> list\nreturn a type's method resolution order"},
 	{0}
--- 844,848 ----
 
 static PyMethodDef type_methods[] = {
! 	{"mro", (PyCFunction)mro_external, METH_NOARGS,
 	 "mro() -> list\nreturn a type's method resolution order"},
 	{0}
Index: unicodeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v
retrieving revision 2.107
retrieving revision 2.108
diff -C2 -d -r2.107 -r2.108
*** unicodeobject.c	2001年08月09日 22:21:55	2.107
--- unicodeobject.c	2001年08月16日 13:15:00	2.108
***************
*** 3252,3259 ****
 
 static PyObject*
! unicode_title(PyUnicodeObject *self, PyObject *args)
 {
- if (!PyArg_NoArgs(args))
- return NULL;
 return fixup(self, fixtitle);
 }
--- 3252,3257 ----
 
 static PyObject*
! unicode_title(PyUnicodeObject *self)
 {
 return fixup(self, fixtitle);
 }
***************
*** 3266,3273 ****
 
 static PyObject*
! unicode_capitalize(PyUnicodeObject *self, PyObject *args)
 {
- if (!PyArg_NoArgs(args))
- return NULL;
 return fixup(self, fixcapitalize);
 }
--- 3264,3269 ----
 
 static PyObject*
! unicode_capitalize(PyUnicodeObject *self)
 {
 return fixup(self, fixcapitalize);
 }
***************
*** 3281,3285 ****
 
 static PyObject*
! unicode_capwords(PyUnicodeObject *self, PyObject *args)
 {
 PyObject *list;
--- 3277,3281 ----
 
 static PyObject*
! unicode_capwords(PyUnicodeObject *self)
 {
 PyObject *list;
***************
*** 3287,3293 ****
 int i;
 
- if (!PyArg_NoArgs(args))
- return NULL;
- 
 /* Split into words */
 list = split(self, NULL, -1);
--- 3283,3286 ----
***************
*** 3772,3776 ****
 
 static PyObject*
! unicode_islower(PyUnicodeObject *self, PyObject *args)
 {
 register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self);
--- 3765,3769 ----
 
 static PyObject*
! unicode_islower(PyUnicodeObject *self)
 {
 register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self);
***************
*** 3778,3784 ****
 int cased;
 
- if (!PyArg_NoArgs(args))
- return NULL;
- 
 /* Shortcut for single character strings */
 if (PyUnicode_GET_SIZE(self) == 1)
--- 3771,3774 ----
***************
*** 3809,3813 ****
 
 static PyObject*
! unicode_isupper(PyUnicodeObject *self, PyObject *args)
 {
 register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self);
--- 3799,3803 ----
 
 static PyObject*
! unicode_isupper(PyUnicodeObject *self)
 {
 register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self);
***************
*** 3815,3821 ****
 int cased;
 
- if (!PyArg_NoArgs(args))
- return NULL;
- 
 /* Shortcut for single character strings */
 if (PyUnicode_GET_SIZE(self) == 1)
--- 3805,3808 ----
***************
*** 3847,3851 ****
 
 static PyObject*
! unicode_istitle(PyUnicodeObject *self, PyObject *args)
 {
 register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self);
--- 3834,3838 ----
 
 static PyObject*
! unicode_istitle(PyUnicodeObject *self)
 {
 register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self);
***************
*** 3853,3859 ****
 int cased, previous_is_cased;
 
- if (!PyArg_NoArgs(args))
- return NULL;
- 
 /* Shortcut for single character strings */
 if (PyUnicode_GET_SIZE(self) == 1)
--- 3840,3843 ----
***************
*** 3896,3907 ****
 
 static PyObject*
! unicode_isspace(PyUnicodeObject *self, PyObject *args)
 {
 register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self);
 register const Py_UNICODE *e;
 
- if (!PyArg_NoArgs(args))
- return NULL;
- 
 /* Shortcut for single character strings */
 if (PyUnicode_GET_SIZE(self) == 1 &&
--- 3880,3888 ----
 
 static PyObject*
! unicode_isspace(PyUnicodeObject *self)
 {
 register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self);
 register const Py_UNICODE *e;
 
 /* Shortcut for single character strings */
 if (PyUnicode_GET_SIZE(self) == 1 &&
***************
*** 3928,3939 ****
 
 static PyObject*
! unicode_isalpha(PyUnicodeObject *self, PyObject *args)
 {
 register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self);
 register const Py_UNICODE *e;
 
- if (!PyArg_NoArgs(args))
- return NULL;
- 
 /* Shortcut for single character strings */
 if (PyUnicode_GET_SIZE(self) == 1 &&
--- 3909,3917 ----
 
 static PyObject*
! unicode_isalpha(PyUnicodeObject *self)
 {
 register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self);
 register const Py_UNICODE *e;
 
 /* Shortcut for single character strings */
 if (PyUnicode_GET_SIZE(self) == 1 &&
***************
*** 3960,3971 ****
 
 static PyObject*
! unicode_isalnum(PyUnicodeObject *self, PyObject *args)
 {
 register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self);
 register const Py_UNICODE *e;
 
- if (!PyArg_NoArgs(args))
- return NULL;
- 
 /* Shortcut for single character strings */
 if (PyUnicode_GET_SIZE(self) == 1 &&
--- 3938,3946 ----
 
 static PyObject*
! unicode_isalnum(PyUnicodeObject *self)
 {
 register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self);
 register const Py_UNICODE *e;
 
 /* Shortcut for single character strings */
 if (PyUnicode_GET_SIZE(self) == 1 &&
***************
*** 3992,4003 ****
 
 static PyObject*
! unicode_isdecimal(PyUnicodeObject *self, PyObject *args)
 {
 register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self);
 register const Py_UNICODE *e;
 
- if (!PyArg_NoArgs(args))
- return NULL;
- 
 /* Shortcut for single character strings */
 if (PyUnicode_GET_SIZE(self) == 1 &&
--- 3967,3975 ----
 
 static PyObject*
! unicode_isdecimal(PyUnicodeObject *self)
 {
 register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self);
 register const Py_UNICODE *e;
 
 /* Shortcut for single character strings */
 if (PyUnicode_GET_SIZE(self) == 1 &&
***************
*** 4024,4035 ****
 
 static PyObject*
! unicode_isdigit(PyUnicodeObject *self, PyObject *args)
 {
 register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self);
 register const Py_UNICODE *e;
 
- if (!PyArg_NoArgs(args))
- return NULL;
- 
 /* Shortcut for single character strings */
 if (PyUnicode_GET_SIZE(self) == 1 &&
--- 3996,4004 ----
 
 static PyObject*
! unicode_isdigit(PyUnicodeObject *self)
 {
 register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self);
 register const Py_UNICODE *e;
 
 /* Shortcut for single character strings */
 if (PyUnicode_GET_SIZE(self) == 1 &&
***************
*** 4056,4067 ****
 
 static PyObject*
! unicode_isnumeric(PyUnicodeObject *self, PyObject *args)
 {
 register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self);
 register const Py_UNICODE *e;
 
- if (!PyArg_NoArgs(args))
- return NULL;
- 
 /* Shortcut for single character strings */
 if (PyUnicode_GET_SIZE(self) == 1 &&
--- 4025,4033 ----
 
 static PyObject*
! unicode_isnumeric(PyUnicodeObject *self)
 {
 register const Py_UNICODE *p = PyUnicode_AS_UNICODE(self);
 register const Py_UNICODE *e;
 
 /* Shortcut for single character strings */
 if (PyUnicode_GET_SIZE(self) == 1 &&
***************
*** 4088,4098 ****
 
 static PyObject*
! unicode_join(PyUnicodeObject *self, PyObject *args)
 {
! PyObject *data;
! if (!PyArg_ParseTuple(args, "O:join", &data))
! return NULL;
! 
! return PyUnicode_Join((PyObject *)self, data);
 }
 
--- 4054,4060 ----
 
 static PyObject*
! unicode_join(PyObject *self, PyObject *data)
 {
! return PyUnicode_Join(self, data);
 }
 
***************
*** 4130,4137 ****
 
 static PyObject*
! unicode_lower(PyUnicodeObject *self, PyObject *args)
 {
- if (!PyArg_NoArgs(args))
- return NULL;
 return fixup(self, fixlower);
 }
--- 4092,4097 ----
 
 static PyObject*
! unicode_lower(PyUnicodeObject *self)
 {
 return fixup(self, fixlower);
 }
***************
*** 4143,4150 ****
 
 static PyObject *
! unicode_lstrip(PyUnicodeObject *self, PyObject *args)
 {
- if (!PyArg_NoArgs(args))
- return NULL;
 return strip(self, 1, 0);
 }
--- 4103,4108 ----
 
 static PyObject *
! unicode_lstrip(PyUnicodeObject *self)
 {
 return strip(self, 1, 0);
 }
***************
*** 4358,4365 ****
 
 static PyObject *
! unicode_rstrip(PyUnicodeObject *self, PyObject *args)
 {
- if (!PyArg_NoArgs(args))
- return NULL;
 return strip(self, 0, 1);
 }
--- 4316,4321 ----
 
 static PyObject *
! unicode_rstrip(PyUnicodeObject *self)
 {
 return strip(self, 0, 1);
 }
***************
*** 4466,4473 ****
 
 static PyObject *
! unicode_strip(PyUnicodeObject *self, PyObject *args)
 {
- if (!PyArg_NoArgs(args))
- return NULL;
 return strip(self, 1, 1);
 }
--- 4422,4427 ----
 
 static PyObject *
! unicode_strip(PyUnicodeObject *self)
 {
 return strip(self, 1, 1);
 }
***************
*** 4480,4487 ****
 
 static PyObject*
! unicode_swapcase(PyUnicodeObject *self, PyObject *args)
 {
- if (!PyArg_NoArgs(args))
- return NULL;
 return fixup(self, fixswapcase);
 }
--- 4434,4439 ----
 
 static PyObject*
! unicode_swapcase(PyUnicodeObject *self)
 {
 return fixup(self, fixswapcase);
 }
***************
*** 4496,4505 ****
 
 static PyObject*
! unicode_translate(PyUnicodeObject *self, PyObject *args)
 {
- PyObject *table;
- 
- if (!PyArg_ParseTuple(args, "O:translate", &table))
- 	return NULL;
 return PyUnicode_TranslateCharmap(self->str, 
 				 self->length,
--- 4448,4453 ----
 
 static PyObject*
! unicode_translate(PyUnicodeObject *self, PyObject *table)
 {
 return PyUnicode_TranslateCharmap(self->str, 
 				 self->length,
***************
*** 4514,4521 ****
 
 static PyObject*
! unicode_upper(PyUnicodeObject *self, PyObject *args)
 {
- if (!PyArg_NoArgs(args))
- return NULL;
 return fixup(self, fixupper);
 }
--- 4462,4467 ----
 
 static PyObject*
! unicode_upper(PyUnicodeObject *self)
 {
 return fixup(self, fixupper);
 }
***************
*** 4559,4566 ****
 #if 0
 static PyObject*
! unicode_freelistsize(PyUnicodeObject *self, PyObject *args)
 {
- if (!PyArg_NoArgs(args))
- return NULL;
 return PyInt_FromLong(unicode_freelist_size);
 }
--- 4505,4510 ----
 #if 0
 static PyObject*
! unicode_freelistsize(PyUnicodeObject *self)
 {
 return PyInt_FromLong(unicode_freelist_size);
 }
***************
*** 4634,4680 ****
 appear first, since lookup is done sequentially. */
 
! {"encode", (PyCFunction) unicode_encode, 1, encode__doc__},
! {"replace", (PyCFunction) unicode_replace, 1, replace__doc__},
! {"split", (PyCFunction) unicode_split, 1, split__doc__},
! {"join", (PyCFunction) unicode_join, 1, join__doc__},
! {"capitalize", (PyCFunction) unicode_capitalize, 0, capitalize__doc__},
! {"title", (PyCFunction) unicode_title, 0, title__doc__},
! {"center", (PyCFunction) unicode_center, 1, center__doc__},
! {"count", (PyCFunction) unicode_count, 1, count__doc__},
! {"expandtabs", (PyCFunction) unicode_expandtabs, 1, expandtabs__doc__},
! {"find", (PyCFunction) unicode_find, 1, find__doc__},
! {"index", (PyCFunction) unicode_index, 1, index__doc__},
! {"ljust", (PyCFunction) unicode_ljust, 1, ljust__doc__},
! {"lower", (PyCFunction) unicode_lower, 0, lower__doc__},
! {"lstrip", (PyCFunction) unicode_lstrip, 0, lstrip__doc__},
! /* {"maketrans", (PyCFunction) unicode_maketrans, 1, maketrans__doc__}, */
! {"rfind", (PyCFunction) unicode_rfind, 1, rfind__doc__},
! {"rindex", (PyCFunction) unicode_rindex, 1, rindex__doc__},
! {"rjust", (PyCFunction) unicode_rjust, 1, rjust__doc__},
! {"rstrip", (PyCFunction) unicode_rstrip, 0, rstrip__doc__},
! {"splitlines", (PyCFunction) unicode_splitlines, 1, splitlines__doc__},
! {"strip", (PyCFunction) unicode_strip, 0, strip__doc__},
! {"swapcase", (PyCFunction) unicode_swapcase, 0, swapcase__doc__},
! {"translate", (PyCFunction) unicode_translate, 1, translate__doc__},
! {"upper", (PyCFunction) unicode_upper, 0, upper__doc__},
! {"startswith", (PyCFunction) unicode_startswith, 1, startswith__doc__},
! {"endswith", (PyCFunction) unicode_endswith, 1, endswith__doc__},
! {"islower", (PyCFunction) unicode_islower, 0, islower__doc__},
! {"isupper", (PyCFunction) unicode_isupper, 0, isupper__doc__},
! {"istitle", (PyCFunction) unicode_istitle, 0, istitle__doc__},
! {"isspace", (PyCFunction) unicode_isspace, 0, isspace__doc__},
! {"isdecimal", (PyCFunction) unicode_isdecimal, 0, isdecimal__doc__},
! {"isdigit", (PyCFunction) unicode_isdigit, 0, isdigit__doc__},
! {"isnumeric", (PyCFunction) unicode_isnumeric, 0, isnumeric__doc__},
! {"isalpha", (PyCFunction) unicode_isalpha, 0, isalpha__doc__},
! {"isalnum", (PyCFunction) unicode_isalnum, 0, isalnum__doc__},
 #if 0
! {"zfill", (PyCFunction) unicode_zfill, 1, zfill__doc__},
! {"capwords", (PyCFunction) unicode_capwords, 0, capwords__doc__},
 #endif
 
 #if 0
 /* This one is just used for debugging the implementation. */
! {"freelistsize", (PyCFunction) unicode_freelistsize, 0},
 #endif
 
--- 4578,4624 ----
 appear first, since lookup is done sequentially. */
 
! {"encode", (PyCFunction) unicode_encode, METH_VARARGS, encode__doc__},
! {"replace", (PyCFunction) unicode_replace, METH_VARARGS, replace__doc__},
! {"split", (PyCFunction) unicode_split, METH_VARARGS, split__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__},
! {"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__},
! {"lstrip", (PyCFunction) unicode_lstrip, METH_NOARGS, lstrip__doc__},
! /* {"maketrans", (PyCFunction) unicode_maketrans, METH_VARARGS, maketrans__doc__}, */
! {"rfind", (PyCFunction) unicode_rfind, METH_VARARGS, rfind__doc__},
! {"rindex", (PyCFunction) unicode_rindex, METH_VARARGS, rindex__doc__},
! {"rjust", (PyCFunction) unicode_rjust, METH_VARARGS, rjust__doc__},
! {"rstrip", (PyCFunction) unicode_rstrip, METH_NOARGS, rstrip__doc__},
! {"splitlines", (PyCFunction) unicode_splitlines, METH_VARARGS, splitlines__doc__},
! {"strip", (PyCFunction) unicode_strip, METH_NOARGS, 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__},
! {"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__},
 #if 0
! {"zfill", (PyCFunction) unicode_zfill, METH_VARARGS, zfill__doc__},
! {"capwords", (PyCFunction) unicode_capwords, METH_NOARGS, capwords__doc__},
 #endif
 
 #if 0
 /* This one is just used for debugging the implementation. */
! {"freelistsize", (PyCFunction) unicode_freelistsize, METH_NOARGS},
 #endif
 

AltStyle によって変換されたページ (->オリジナル) /