diff Include/stringobject.h @ 18129:9d533ae574d2 legacy-trunk

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.
author Tim Peters <tim.peters@gmail.com>
date Sat, 16 Jun 2001 05:11:17 +0000
parents 5e1141157d53
children bc63afc701ef
line wrap: on
line diff
--- a/Include/stringobject.h	Sat Jun 16 00:09:28 2001 +0000
+++ b/Include/stringobject.h	Sat Jun 16 05:11:17 2001 +0000
@@ -77,6 +77,10 @@
 #define PyString_AS_STRING(op) (((PyStringObject *)(op))->ob_sval)
 #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 ----------------------------------------------------- */
 
 /* Create an object by decoding the encoded string s of the