Lists, tuples and memory.

David Eppstein eppstein at ics.uci.edu
Fri Jul 16 22:36:15 CEST 2004


In article <Pine.LNX.4.44.0407161419040.20713-100000 at ccc7.wpi.edu>,
 Christopher T King <squirrel at WPI.EDU> wrote:

> On Fri, 16 Jul 2004, Peter Otten wrote:
> 
> > Christopher T King wrote:
> > 
> > > Try using a set instead of a dictionary. You should get the good access
> > > time of dictionaries with nearly the low memory usage of a list:
> > 
> > sets.Set() holds its data in a dict. I fear the same goes for 2.4's builtin
> > set type which is coded in C but also built on top of dict.
> 
> Ick.  I thought part of the reason Set was created (aside from enabling 
> set operations) was to improve on the dict() storage method.

What alternative storage method did you have in mind that would be as 
efficient and that would allow the same types of objects to be collected 
into sets?

-- 
David Eppstein                      http://www.ics.uci.edu/~eppstein/
Univ. of California, Irvine, School of Information & Computer Science



More information about the Python-list mailing list