merging really huge lists fast

Alex alex at somewhere.round.here
Sun Feb 13 12:25:50 EST 2000


> the good old new_list = list1 + list2 seems to be slow. Any hints?

How slow?  Like "slow to run a million times in a row", or "it takes
over a second to execute this one command?"  

You might try the "extend" method: list1.extend (list2)

That'll only work if you don't need the original list1 anymore, though. 

Alex.



More information about the Python-list mailing list