<div class="gmail_quote">2011/11/25 Paul Moore <span dir="ltr">&lt;<a href="mailto:p.f.moore@gmail.com">p.f.moore@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":1tc">The optimisation mentioned was an attempt (by mutating an existing<br>
string when the runtime determined that it was safe to do so) to hide<br>
the consequences of this fact from end-users who didn&#39;t fully<br>
understand the issues. It was relatively effective, but like any such<br>
case (floating point is another common example) it did some level of<br>
harm at the same time as it helped (by obscuring the issue further).<br>
<br>
It would be nice to have the optimisation back if it&#39;s easy enough to<br>
do so, for quick-and-dirty code, but it is not a good idea to rely on<br>
it (and it&#39;s especially unwise to base benchmarks on it working :-))</div></blockquote></div><br>Note that this string optimization hack is still present in Python 3,<div>but it now acts on *unicode* strings, not bytes.<br clear="all">
<div><br></div>-- <br>Amaury Forgeot d&#39;Arc<br>
</div>