Large Dictionaries

Diez B. Roggisch deets at nospam.web.de
Mon May 15 21:07:02 CEST 2006


Maric Michaud schrieb:
> Le Lundi 15 Mai 2006 19:24, Roy Smith a écrit :
>> d = {}
>> d.reserve (10*1000*1000)
> 
> d={}.fromkeys(xrange(5*10**6)) ?

That is a totally different beast. You don't want to insert arbitrary 
keys, you want the internal hash-array to be of the right size.

Diez



More information about the Python-list mailing list