Optimizing list processing

Chris Angelico rosuav at gmail.com
Thu Dec 12 09:06:33 EST 2013


On Fri, Dec 13, 2013 at 12:32 AM, MRAB <python at mrabarnett.plus.com> wrote:
>> table[:] = [i for x,i in table]  # Does slice assignment get optimized?
>>
> [snip]
>
> If you're trying that, you could also try:
>
> table[:] = (i for x,i in table)

Right, a tweak which could be applied also to the split version. Thanks MRAB.

ChrisA



More information about the Python-list mailing list