On 17.10.2016 23:53, Paul Moore wrote:
On 17 October 2016 at 22:28, Mark Lawrence via Python-ideas
wrote:
How about changing https://wiki.python.org/moin/HowTo/Sorting ?
Good point. Better still, https://docs.python.org/3.6/howto/sorting.html
Don't know what the real difference between those
[Sven R. Kunze ]
> Indeed. I also didn't know about that detail of reversing. :) Amazing. (Also
> welcome to the list, Alireza.)
It follows from what the docs say, although I'd agree it may be
helpful if the docs explicitly spelled out this consequence (that
reverse=True also preserves the origina
On 17 October 2016 at 22:28, Mark Lawrence via Python-ideas
wrote:
> How about changing https://wiki.python.org/moin/HowTo/Sorting ?
Good point. Better still, https://docs.python.org/3.6/howto/sorting.html
Paul
___
Python-ideas mailing list
Python-idea
On 17/10/2016 21:31, Paul Moore wrote:
On 17 October 2016 at 21:06, Sven R. Kunze wrote:
Do you think that simple solution could have a chance to be added to stdlib
somehow (with the possibility of speeding it up in the future)?
You could submit a doc patch to add an explanation of this techn
On 17.10.2016 22:31, Paul Moore wrote:
On 17 October 2016 at 21:06, Sven R. Kunze wrote:
Do you think that simple solution could have a chance to be added to stdlib
somehow (with the possibility of speeding it up in the future)?
You could submit a doc patch to add an explanation of this techni
On 17 October 2016 at 21:06, Sven R. Kunze wrote:
> Do you think that simple solution could have a chance to be added to stdlib
> somehow (with the possibility of speeding it up in the future)?
You could submit a doc patch to add an explanation of this technique
to the list.sort function. I doubt
On 16.10.2016 09:35, Alireza Rafiei wrote:
Awesome! Thanks for the thorough explanation.
Indeed. I also didn't know about that detail of reversing. :) Amazing.
(Also welcome to the list, Alireza.)
def multisort(xs, specs):
for key, reverse in reversed(specs):
On 16 October 2016 at 08:35, Alireza Rafiei wrote:
> Awesome! Thanks for the thorough explanation.
Thank you for the interesting suggestion that prompted the
explanation. I don't know about others, but I know that I often forget
ways to use the tools already at our disposal, so threads like this
Awesome! Thanks for the thorough explanation.
On Sat, Oct 15, 2016 at 11:01 PM, Tim Peters wrote:
> [Alireza Rafiei ]
> > I have a list called count_list which contains tuples like below:
> >
> > > [('bridge', 2), ('fair', 1), ('lady', 1), ('is', 2), ('down', 4),
> > > ('london', 2), ('falling',
[Alireza Rafiei ]
> I have a list called count_list which contains tuples like below:
>
> > [('bridge', 2), ('fair', 1), ('lady', 1), ('is', 2), ('down', 4),
> > ('london', 2), ('falling', 4), ('my', 1)]
>
>
> I want to sort it based on the second parameter in descending order and the
> tuples with
On Sun, Oct 16, 2016 at 3:29 PM, Alireza Rafiei
wrote:
> What I ended up doing is:
>
>> count_list = sorted(count_list,
>> key=lambda x: (x[1], map(lambda x: -x, map(ord,
>> x[0]))),
>> reverse=True)
>
>
> which works. Now my solution is very specific to str
Hi all,
I have a list called count_list which contains tuples like below:
[('bridge', 2), ('fair', 1), ('lady', 1), ('is', 2), ('down', 4),
> ('london', 2), ('falling', 4), ('my', 1)]
I want to sort it based on the second parameter in descending order and the
tuples with the same second paramet
12 matches
Mail list logo