On Wed, Feb 13, 2013 at 11:10:26PM +1100, Steven D'Aprano wrote: > Best practice remains the same: > > - we should still use join for repeated concatenations; > > - we should still avoid + except for small cases which are not performance > critical; > > - we should still teach beginners to use join; > > - while this optimization is nice to have, we cannot rely on it being there > when it matters. > > It's not just Jython and IronPython that can't make use of this optimization. > It > can, and does, fail on CPython as well, as it is sensitive to memory > allocation details. See for example: > > http://utcc.utoronto.ca/~cks/space/blog/python/ExaminingStringConcatOpt > > and here for a cautionary tale about what can happen when the optimization > fails > under CPython: > > http://mail.python.org/pipermail/python-dev/2009-August/091125.html
Is that the right link? This thread doesn't mention +=, the bug mentioned in the first email doesn't mention +=, and the fix mentioned for that bug appears to be "let's not pass 0 as the buffer size of sock.makefile()". Did I skim too much? Marius Gedminas -- And yes, you'd be insane to consider C++ for a new project in 2007. -- Thomas Ptacek
signature.asc
Description: Digital signature
_______________________________________________ pypy-dev mailing list pypy-dev@python.org http://mail.python.org/mailman/listinfo/pypy-dev