creating really big lists

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Fri Sep 7 21:33:36 EDT 2007


En Fri, 07 Sep 2007 16:16:46 -0300, Dr Mephesto <dnhkng at googlemail.com>  
escribi�:

> hey, that defaultdict thing looks pretty cool...
>
> whats the overhead like for using a dictionary in python?

Dictionaries are heavily optimized in Python. Access time is O(1),  
adding/removing elements is amortized O(1) (that is, constant time unless  
it has to grow/shrink some internal structures.)

-- 
Gabriel Genellina




More information about the Python-list mailing list