[issue1569040] Speed up using + for string concatenation

Larry Hastings report at bugs.python.org
Tue Mar 31 19:15:27 CEST 2009


Larry Hastings <larry at hastings.org> added the comment:

Thanks for pointing that out!  I think I found it; the discussion is
actually about lazy string slices, and it starts here:
http://mail.python.org/pipermail/python-dev/2000-February/002317.html
If I were to resubmit lazy string slices (which wouldn't be in this
patch), the slices would only have weakrefs on the original string and
render when the original string was destroyed.  That addresses some of
the concerns about lazy string slices, though they are still
uncomfortably (internally) complex.

As for the second concern: the official way is to use the accessors, and
CPython consistently uses them itself.  I don't know what the right
answer is.  We *could* make PyStringObject a private type to force the
issue, though that would add overhead.

(Well, PyUnicodeObject really, this would never be accepted in the 2.x
series at this point.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1569040>
_______________________________________


More information about the Python-bugs-list mailing list