[Python-Dev] Continuous Sets in 2.3 set implementation?

Tim Peters tim.one@comcast.net
Mon, 11 Nov 2002 00:50:14 -0500

[Frank Horowitz]
> I've had a quick read through of the CVS version of the set.py code. The
> class as implemented looks nice and clean for what I would call
> "discrete sets" (e.g. iterable). (I do like the idea of using the dict
> implementation!)
> However, one thing bothers me. Certain operations, such as unions,
> intersections, and symmetric differences, make sense for "continuous
> sets" too (think about intervals on the line).
> I know it's probably too late in the development cycle to get any
> meaningful continuous set operations supported, but is there any hope of
> renaming the implementation to something along the lines of "dsets" to
> remind the user of the discreteness? (Am I being too pedantic?)

No and yes.  Discrete sets have been suggested as a Python addition non-stop
for at least 10 years.  This is the (I think) second time I've heard someone
ask for intervals.  So like when you import math you get real-valued math
functions, and need to import cmath if you want complex-valued ones, even
more so when you import sets you should get the flavor of set 99.9999167% of
the world's population expects to get.  The other two of you can create a
new module with a clumsier name (I suggest intset.py, just to confuse
newbies <wink>).