On Jan 22, 3:56 am, MRAB <goo...@mrabarnett.plus.com> wrote:
> I was referring to the code:
>
>      for index, record in enumerate(l):
>          if record['title'] == 'ti':
>              l.pop(index)
>
> where you are enumerating and iterating over 'l', but also modifying 'l'
> with 'l.pop(index)'.

Ack, you're absolutely correct.

TP: my mistake, the for loop won't work at all. I'd really recommend
using the dictionary-based solution.

Apologies all around.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to