<div class="gmail_quote">2011/12/13 Armin Rigo <span dir="ltr">&lt;<a href="mailto:arigo@tunes.org">arigo@tunes.org</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":1qz">No, the behavior _is_ undefined.  The comment you cited says that it<br>
cannot crash the Python interpreter; additionally, it makes a<br>
best-effort attempt at catching such accesses and raising ValueError.<br>
But I think I can build a strange-looking example where you mutate a<br>
list during sorting and don&#39;t get a ValueError (although admittedly it<br>
needs a lot of hacking to do that nowadays, e.g. multiple threads).</div></blockquote></div><br>I&#39;m interested to see how!<div>The current implementation installs an empty array in the list,</div><div>and the initial array is only held by a local variable in listsort().</div>
<div>even gc.get_referrers() can return the empty list...<br clear="all"><div><br></div>-- <br>Amaury Forgeot d&#39;Arc<br>
</div>