[issue25792] sorted() is not stable given key=len and large inputs

2015-12-03 Thread R. David Murray
R. David Murray added the comment: If you use key=len, then what you get out is the items sorted by length. key determines *exactly* the test used to sort the input. "Stable" in a sort means that in the absence of the sort key differentiating the entries, they remain in the same order as in

[issue25792] sorted() is not stable given key=len and large inputs

2015-12-03 Thread Sam Obstgarten
New submission from Sam Obstgarten: Tested under MacOS 10.11.1 Python 2.7.8 When using sorted() with key=len, sorted() is not stable (i.e. it does not return the same sorting depending on the input file). I expected, that sorted() sorts (i) first according the string length and then (ii) alpha