[issue13805] [].sort() should return self

Ezio Melotti report at bugs.python.org
Tue Jan 17 11:24:36 CET 2012


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

This is by design.
Methods that mutate the object return None.
Methods that create a new object return the new object.
list.sort sorts the list in place, so it returns None.

----------
nosy: +ezio.melotti
resolution:  -> rejected
stage:  -> committed/rejected
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13805>
_______________________________________


More information about the Python-bugs-list mailing list