the most efficient method of adding elements to the list
sreeram at tachyontech.net
Tue Jun 6 06:49:09 CEST 2006
> Would it be .append()? Does it reallocate te list with each apend?
No append does NOT reallocate for every call. Whenever a reallocation
happens, the newsize is proportional to the older size. So you should
essentially get amortized constant time for every append call.
If you want to add a bunch of items in one call.. you should use the
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 260 bytes
Desc: OpenPGP digital signature
More information about the Python-list