[Python-checkins] CVS: python/dist/src/Include stringobject.h,2.27,2.28

Tim Peters tim_one@users.sourceforge.net
Fri, 15 Jun 2001 22:11:19 -0700


Update of /cvsroot/python/python/dist/src/Include
In directory usw-pr-cvs1:/tmp/cvs-serv12913/python/dist/src/Include

Modified Files:
	stringobject.h 
Log Message:
SF bug 433228: repr(list) woes when len(list) big.
Gave Python linear-time repr() implementations for dicts, lists, strings.
This means, e.g., that repr(range(50000)) is no longer 50x slower than
pprint.pprint() in 2.2 <wink>.

I don't consider this a bugfix candidate, as it's a performance boost.

Added _PyString_Join() to the internal string API.  If we want that in the
public API, fine, but then it requires runtime error checks instead of
asserts.


Index: stringobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/stringobject.h,v
retrieving revision 2.27
retrieving revision 2.28
diff -C2 -r2.27 -r2.28
*** stringobject.h	2001/05/24 16:56:35	2.27
--- stringobject.h	2001/06/16 05:11:17	2.28
***************
*** 78,81 ****
--- 78,85 ----
  #define PyString_GET_SIZE(op)  (((PyStringObject *)(op))->ob_size)
  
+ /* _PyString_Join(sep, x) is like sep.join(x).  sep must be PyStringObject*,
+    x must be an iterable object. */
+ extern DL_IMPORT(PyObject *) _PyString_Join(PyObject *sep, PyObject *x);
+ 
  /* --- Generic Codecs ----------------------------------------------------- */