a.extend(b) better than a+=b ?

candide candide at free.invalid
Thu Apr 22 03:10:42 EDT 2010

Suppose a and b are lists.

What is more efficient in order to extend the list a by appending all 
the items in the list b ?

I imagine a.extend(b)to be more efficient for only appendinding the 
items from b while a+=b creates a copy of a before appending, right ?

More information about the Python-list mailing list