[Python-ideas] suggestion about the sort() function of the list instance

qhlonline qhlonline at 163.com
Sun Feb 26 22:07:33 EST 2017


Hi, all
    I have a suggestion that, the sort() member method of the list instance, should return the 'self' as  the result of list.sort() call. 
    Now list.sort() returns nothing, so that I can NOT write code like this:


    res =  {item: func(item) for item in item_list.sort()}
 
    It feels bad.


Regards!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170227/f14b56ea/attachment.html>


More information about the Python-ideas mailing list