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

François Pinard pinard@iro.umontreal.ca
20 Aug 2002 22:59:46 -0400


[Guido van Rossum]

> Um, the notation is '|' and '&', not 'or' and 'and', and those are
> what I learned in school.  Seems pretty conventional to me (Greg
> Wilson actually tried this out on unsuspecting newbies and found that
> while '+' worked okay, '*' did not -- read the PEP).

The very usual notation for me has been the big `U' for union and the same,
upside-down, for intersection, but even now that Python supports Unicode,
these are not Python operators _yet_. :-)

I never saw `|' nor `&' in literature, except `|' which means "such that"
in set comprehensions, as Pythoneers would be tempted to say!  On the
other hand, for programmers, `|' and `&' are rather natural and easy.

Eric has offered the idea of adding Cartesian product, and despite the
usual notation is a tall thin `X', maybe it would be nice reserving `*'
for that?  It might not be explicit enough, and besides, there are other
circumstances in Algebra, not so far from sets, when one might need many
multiplicative operators, so `*' would easily get over-used.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard