[Python-checkins] CVS: python/dist/src/Objects complexobject.c,2.22,2.23 fileobject.c,2.69,2.70 stringobject.c,2.54,2.55

Guido van Rossum guido@cnri.reston.va.us
Tue, 29 Feb 2000 08:59:31 -0500 (EST)


Update of /projects/cvsroot/python/dist/src/Objects
In directory eric:/projects/python/develop/guido/src/Objects

Modified Files:
	complexobject.c fileobject.c stringobject.c 
Log Message:
Massive patch by Skip Montanaro to add ":name" to as many
PyArg_ParseTuple() format string arguments as possible.


Index: complexobject.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Objects/complexobject.c,v
retrieving revision 2.22
retrieving revision 2.23
diff -C2 -r2.22 -r2.23
*** complexobject.c	2000/01/20 22:32:54	2.22
--- complexobject.c	2000/02/29 13:59:28	2.23
***************
*** 579,583 ****
  {
  	Py_complex c;
! 	if (!PyArg_ParseTuple(args, ""))
  		return NULL;
  	c = ((PyComplexObject *)self)->cval;
--- 579,583 ----
  {
  	Py_complex c;
! 	if (!PyArg_ParseTuple(args, ":conjugate"))
  		return NULL;
  	c = ((PyComplexObject *)self)->cval;

Index: fileobject.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Objects/fileobject.c,v
retrieving revision 2.69
retrieving revision 2.70
diff -C2 -r2.69 -r2.70
*** fileobject.c	1999/08/27 20:38:57	2.69
--- fileobject.c	2000/02/29 13:59:28	2.70
***************
*** 264,268 ****
  		return err_closed();
  	whence = 0;
! 	if (!PyArg_ParseTuple(args, "O|i", &offobj, &whence))
  		return NULL;
  #if !defined(HAVE_LARGEFILE_SUPPORT)
--- 264,268 ----
  		return err_closed();
  	whence = 0;
! 	if (!PyArg_ParseTuple(args, "O|i:seek", &offobj, &whence))
  		return NULL;
  #if !defined(HAVE_LARGEFILE_SUPPORT)
***************
*** 306,310 ****
  		return err_closed();
  	newsizeobj = NULL;
! 	if (!PyArg_ParseTuple(args, "|O", &newsizeobj))
  		return NULL;
  	if (newsizeobj != NULL) {
--- 306,310 ----
  		return err_closed();
  	newsizeobj = NULL;
! 	if (!PyArg_ParseTuple(args, "|O:truncate", &newsizeobj))
  		return NULL;
  	if (newsizeobj != NULL) {
***************
*** 519,523 ****
  	if (f->f_fp == NULL)
  		return err_closed();
! 	if (!PyArg_ParseTuple(args, "|l", &bytesrequested))
  		return NULL;
  	if (bytesrequested < 0)
--- 519,523 ----
  	if (f->f_fp == NULL)
  		return err_closed();
! 	if (!PyArg_ParseTuple(args, "|l:read", &bytesrequested))
  		return NULL;
  	if (bytesrequested < 0)
***************
*** 733,737 ****
  	if (f->f_fp == NULL)
  		return err_closed();
! 	if (!PyArg_ParseTuple(args, "|i", &n))
  		return NULL;
  	if (n == 0)
--- 733,737 ----
  	if (f->f_fp == NULL)
  		return err_closed();
! 	if (!PyArg_ParseTuple(args, "|i:readline", &n))
  		return NULL;
  	if (n == 0)
***************
*** 762,766 ****
  	if (f->f_fp == NULL)
  		return err_closed();
! 	if (!PyArg_ParseTuple(args, "|l", &sizehint))
  		return NULL;
  	if ((list = PyList_New(0)) == NULL)
--- 762,766 ----
  	if (f->f_fp == NULL)
  		return err_closed();
! 	if (!PyArg_ParseTuple(args, "|l:readlines", &sizehint))
  		return NULL;
  	if ((list = PyList_New(0)) == NULL)

Index: stringobject.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Objects/stringobject.c,v
retrieving revision 2.54
retrieving revision 2.55
diff -C2 -r2.54 -r2.55
*** stringobject.c	2000/01/20 22:32:54	2.54
--- stringobject.c	2000/02/29 13:59:28	2.55
***************
*** 613,617 ****
  	splitcount = 0;
  	maxsplit = 0;
! 	if (!PyArg_ParseTuple(args, "|z#i", &sub, &n, &maxsplit))
  		return NULL;
  	if (sub == NULL)
--- 613,617 ----
  	splitcount = 0;
  	maxsplit = 0;
! 	if (!PyArg_ParseTuple(args, "|z#i:split", &sub, &n, &maxsplit))
  		return NULL;
  	if (sub == NULL)
***************
*** 681,685 ****
  	PyObject *seq;
  
! 	if (!PyArg_ParseTuple(args, "O", &seq))
  		return NULL;
  
--- 681,685 ----
  	PyObject *seq;
  
! 	if (!PyArg_ParseTuple(args, "O:join", &seq))
  		return NULL;
  
***************
*** 770,774 ****
  	int n, i = 0, last = INT_MAX;
  
! 	if (!PyArg_ParseTuple(args, "t#|ii", &sub, &n, &i, &last))
  		return -2;
  
--- 770,774 ----
  	int n, i = 0, last = INT_MAX;
  
! 	if (!PyArg_ParseTuple(args, "t#|ii:find", &sub, &n, &i, &last))
  		return -2;
  
***************
*** 849,853 ****
  	int i = 0, last = INT_MAX;
  
! 	if (!PyArg_ParseTuple(args, "t#|ii", &sub, &n, &i, &last))
  		return -2;
  
--- 849,853 ----
  	int i = 0, last = INT_MAX;
  
! 	if (!PyArg_ParseTuple(args, "t#|ii:rfind", &sub, &n, &i, &last))
  		return -2;
  
***************
*** 927,931 ****
  	int len = PyString_GET_SIZE(self), i, j;
  
! 	if (!PyArg_ParseTuple(args, ""))
  		return NULL;
  
--- 927,931 ----
  	int len = PyString_GET_SIZE(self), i, j;
  
! 	if (!PyArg_ParseTuple(args, ":strip"))
  		return NULL;
  
***************
*** 1011,1015 ****
  	PyObject *new;
  
! 	if (!PyArg_ParseTuple(args, ""))
  		return NULL;
  	new = PyString_FromStringAndSize(NULL, n);
--- 1011,1015 ----
  	PyObject *new;
  
! 	if (!PyArg_ParseTuple(args, ":lower"))
  		return NULL;
  	new = PyString_FromStringAndSize(NULL, n);
***************
*** 1043,1047 ****
  	PyObject *new;
  
! 	if (!PyArg_ParseTuple(args, ""))
  		return NULL;
  	new = PyString_FromStringAndSize(NULL, n);
--- 1043,1047 ----
  	PyObject *new;
  
! 	if (!PyArg_ParseTuple(args, ":upper"))
  		return NULL;
  	new = PyString_FromStringAndSize(NULL, n);
***************
*** 1076,1080 ****
  	PyObject *new;
  
! 	if (!PyArg_ParseTuple(args, ""))
  		return NULL;
  	new = PyString_FromStringAndSize(NULL, n);
--- 1076,1080 ----
  	PyObject *new;
  
! 	if (!PyArg_ParseTuple(args, ":capitalize"))
  		return NULL;
  	new = PyString_FromStringAndSize(NULL, n);
***************
*** 1119,1123 ****
  	int m, r;
  
! 	if (!PyArg_ParseTuple(args, "t#|ii", &sub, &n, &i, &last))
  		return NULL;
  	if (last > len)
--- 1119,1123 ----
  	int m, r;
  
! 	if (!PyArg_ParseTuple(args, "t#|ii:count", &sub, &n, &i, &last))
  		return NULL;
  	if (last > len)
***************
*** 1163,1167 ****
  	PyObject *new;
  
! 	if (!PyArg_ParseTuple(args, ""))
  		return NULL;
  	new = PyString_FromStringAndSize(NULL, n);
--- 1163,1167 ----
  	PyObject *new;
  
! 	if (!PyArg_ParseTuple(args, ":swapcase"))
  		return NULL;
  	new = PyString_FromStringAndSize(NULL, n);
***************
*** 1206,1210 ****
  	int trans_table[256];
  
! 	if (!PyArg_ParseTuple(args, "t#|t#",
  			      &table1, &tablen, &del_table, &dellen))
  		return NULL;
--- 1206,1210 ----
  	int trans_table[256];
  
! 	if (!PyArg_ParseTuple(args, "t#|t#:translate",
  			      &table1, &tablen, &del_table, &dellen))
  		return NULL;
***************
*** 1423,1427 ****
  	PyObject *new;
  
! 	if (!PyArg_ParseTuple(args, "t#t#|i",
  			      &pat, &pat_len, &sub, &sub_len, &count))
  		return NULL;
--- 1423,1427 ----
  	PyObject *new;
  
! 	if (!PyArg_ParseTuple(args, "t#t#|i:replace",
  			      &pat, &pat_len, &sub, &sub_len, &count))
  		return NULL;
***************
*** 1467,1471 ****
  	int end = -1;
  
! 	if (!PyArg_ParseTuple(args, "t#|ii", &prefix, &plen, &start, &end))
  		return NULL;
  
--- 1467,1471 ----
  	int end = -1;
  
! 	if (!PyArg_ParseTuple(args, "t#|ii:startswith", &prefix, &plen, &start, &end))
  		return NULL;
  
***************
*** 1510,1514 ****
  	int lower, upper;
  
! 	if (!PyArg_ParseTuple(args, "t#|ii", &suffix, &plen, &start, &end))
  		return NULL;
  
--- 1510,1514 ----
  	int lower, upper;
  
! 	if (!PyArg_ParseTuple(args, "t#|ii:endswith", &suffix, &plen, &start, &end))
  		return NULL;