[Python-Dev] Dictionary sparseness

Jack Jansen Jack.Jansen@oratrix.com
Mon, 5 May 2003 17:35:55 +0200


I sort-of agree with Guido that any calls to optimize dictionaries may
do more good than bad, but I think that if we make the interface
sufficiently abstract we may have something that may work. I was 
thinking
of something analogous to madvise(): the user can specify high level 
access
patterns.

For Python dictionaries the access patterns would probably be
- I'm going to write a lot of stuff
- I'm done writing, and from now on I'm mainly going to read
- I haven't a clue what I'm going to do

Especially the "I'm going to read from now on" could be put to good use,
for instance after completing the dictionary of a class.
--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- Emma 
Goldman -