[New-bugs-announce] [issue13805] .sort() should return self
report at bugs.python.org
Tue Jan 17 11:21:51 CET 2012
New submission from Martin Häcker <spamfaenger at gmx.de>:
.sort() returns None which means you can't chain it.
So for example someDict.keys().sort() doesn't work but you have to use sorted(someDict.keys()) instead which is harder to read as you have to read the line not from the beginning to the end but jump back and forth in it to understand it (which gets progressively harder as the individual parts of it get longer / more complex).
title: .sort() should return self
versions: Python 2.7
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce