Initializing the number of slots in a dictionary

Jon Smirl jonsmirl at gmail.com
Sun Aug 6 17:03:59 EDT 2006


Is there some way to tell a dictionary object that I am going to load 1M
objects into it and have it pre-allocate enought slots to hold all of the
entries? Thus avoiding many thousand memory allocations.

Jon Smirl
jonsmirl at gmail.com




More information about the Python-list mailing list