<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
On 10/01/2011 09:06 PM, Victor Stinner wrote:<br>
<blockquote
cite="mid:201110012206.11806.victor.stinner@haypocalc.com"
type="cite">
<pre wrap="">Another alternative is a "string-join" object. It is discussed (and
implemented) in the following issue, and PyPy has also an optional
implementation:
<a class="moz-txt-link-freetext" href="http://bugs.python.org/issue1569040">http://bugs.python.org/issue1569040</a>
<a class="moz-txt-link-freetext" href="http://codespeak.net/pypy/dist/pypy/doc/interpreter-optimizations.html#string">http://codespeak.net/pypy/dist/pypy/doc/interpreter-optimizations.html#string</a>-
join-objects
</pre>
</blockquote>
<br>
Yes, actually I was planning on trying to revive my "lazy string
concatenation" patch once PEP 393 landed. As I recall it, the major
roadblock to the patch's acceptance was that it changed the
semantics of PyString_AS_STRING(). With the patch applied,
PyString_AS_STRING() could now fail and return NULL under low-memory
conditions. This meant a major change to the C API and would have
required an audit of 400+ call sites inside CPython alone. I
haven't studied PEP 393 yet, but Martin tells me PyUnicode_READY
would be a good place to render the lazy string.<br>
<br>
Give me a week or two and I should be able to get it together,<br>
<br>
<br>
<i>larry</i><br>
</body>
</html>