Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #40346

Re: Sorting (deeply) nested lists

Newsgroups comp.lang.python
Date 2013-03-02 09:49 -0800
References <c4703b9f-44fd-4a6b-a600-b94de993bb4e@googlegroups.com> <mailman.2783.1362245815.2939.python-list@python.org>
Message-ID <a6b8d573-495d-4c18-bfb0-975ccf44d8a2@googlegroups.com> (permalink)
Subject Re: Sorting (deeply) nested lists
From mamboknave@gmail.com

Show all headers | View raw


On Saturday, March 2, 2013 9:36:43 AM UTC-8, Peter Otten wrote:
>
> You can also write this as
> 
> namedTuples.sort(key=lambda item: item[1][1])
>

That's exactly what I did before and got "IndexError: list index out of range".

So, I thought my lambda was wrong and posted here.

Now, having seen you reply, I dug deeper and... of course I had IndexError: the list was horribly empty!

Thanks so much for replying so quickly, Peter!

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Sorting (deeply) nested lists mamboknave@gmail.com - 2013-03-02 09:18 -0800
  Re: Sorting (deeply) nested lists Peter Otten <__peter__@web.de> - 2013-03-02 18:36 +0100
    Re: Sorting (deeply) nested lists mamboknave@gmail.com - 2013-03-02 09:49 -0800
    Re: Sorting (deeply) nested lists mamboknave@gmail.com - 2013-03-02 09:49 -0800

csiph-web