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

2017-02-26 Thread Jonathan Goble
On Sun, Feb 26, 2017 at 10:23 PM qhlonline wrot > 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 = {

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

2017-02-26 Thread Ryan Birmingham
It sorts the list in place. Can you use sorted(item_list)? -Ryan Birmingham On 26 February 2017 at 22:07, qhlonline wrote: > 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(

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

2017-02-26 Thread qhlonline
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 feel

Re: [Python-ideas] Make Path objects iterable

2017-02-26 Thread Serhiy Storchaka
On 26.02.17 15:39, Vamsi Krishna Avula wrote: This is somewhere between a question and a proposal. I'm just trying to understand why Path objects use an explicit iterdir method. Why not make them iterable? Because this is ambiguous. Iterating can mean many different things: 1. Iterate charact

[Python-ideas] Make Path objects iterable

2017-02-26 Thread Vamsi Krishna Avula
This is somewhere between a question and a proposal. I'm just trying to understand why Path objects use an explicit iterdir method. Why not make them iterable? -- Vamsi ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailma