Hi, On Tue, Dec 13, 2011 at 11:37, Amaury Forgeot d'Arc <amauryfa at gmail.com> wrote: >> "When sorting a list using the sort() method, attempting to inspect or >> mutate the content of the list will result in undefined behaviour." > > (...) > So behaviour is not undefined at all... 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). A bientôt, Armin.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4