2011/12/13 Armin Rigo <ar...@tunes.org> > No, the behavior _is_ undefined. The comment you cited says that it > cannot crash the Python interpreter; additionally, it makes a > best-effort attempt at catching such accesses and raising ValueError. > But I think I can build a strange-looking example where you mutate a > list during sorting and don't get a ValueError (although admittedly it > needs a lot of hacking to do that nowadays, e.g. multiple threads). >
I'm interested to see how! The current implementation installs an empty array in the list, and the initial array is only held by a local variable in listsort(). even gc.get_referrers() can return the empty list... -- Amaury Forgeot d'Arc
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com