[Python-Dev] Re: PEP 218 (sets); moving set.py to Lib

Magnus Lie Hetland magnus@hetland.org
Sat, 24 Aug 2002 16:38:48 +0200

Guido van Rossum <guido@python.org>:
> Have you got a use case for membership tests of a cartesian product?

Not that I can think of at the moment, no :-)

I guess the idea was to use lazy sets for some such operations. Then
you could build complex expressions through cartesian products,
unions, intersections, set differences, set comprehensions etc.
without actually constructing the full set. Checking for membership or
iterating over (or even constructing, after all the operations have
been applied) such a set might be useful, I'm sure... You could
implement joins with cartesian products without terrible performance
penalties etc...

But I guess this sort of thing might as well go into some other module
somewhere (probably outside the libs). It was just a thought.

Magnus Lie Hetland                                  The Anygui Project
http://hetland.org                                  http://anygui.org