[Python-Dev] I think my set module is ready for prime time; comments?

Eric S. Raymond esr@thyrsus.com
Tue, 23 Jan 2001 13:39:04 -0500


uche.ogbuji@fourthought.com <uche.ogbuji@fourthought.com>:
> I've seen so many set hacks with dictionaries (memory ouch) and list
> hacks (speed ouch) in Python code out there, that I'm convinced it
> would meet much more common usage than, say zlib, xdr, or even
> expat.

Uche brings up a point I meant to make in my reply to Guido.  The dict-
vs.-list choice in set representation is indeed a choice between 
memory ouch and speed ouch.  

I believe most uses of sets are small sets.  That reduces the speed ouch
of using a list representation and increases the proportional memory
ouch of a dictionary implementation.
-- 
		<a href="http://www.tuxedo.org/~esr/">Eric S. Raymond</a>

Question with boldness even the existence of a God; because, if there
be one, he must more approve the homage of reason, than that of
blindfolded fear.... Do not be frightened from this inquiry from any
fear of its consequences. If it ends in the belief that there is no
God, you will find incitements to virtue in the comfort and
pleasantness you feel in its exercise...
	-- Thomas Jefferson, in a 1787 letter to his nephew