Why doesn't python's list append() method return the list itself?

Nathan Rice nathan.alexander.rice at gmail.com
Sun Jul 11 12:28:05 EDT 2010


Do list(reversed(list(reversed([1, 2, 3, 4])) + [[]]))

Though TBH sometimes get annoyed at this behavior myself.  There are a lot
of people who are very vocal in support of returning none, and it makes
sense in some ways.  Since reversed returns an iterator though, it makes
this code horrible and unreadable.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100711/4ca3be0b/attachment.html>


More information about the Python-list mailing list