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
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