How to force a single number to be a tuple

Dan Bishop danb_83 at yahoo.com
Sat Aug 7 11:21:15 CEST 2004


Roy Smith <roy at panix.com> wrote in message news:<roy-0B13C1.18151306082004 at reader1.panix.com>...
> bryanjugglercryptographer at yahoo.com (Bryan Olson) wrote:
> > Python tuples overlap too much with lists, and differ from the 
> > functional/relational view in which a tuple is an element of the 
> > Cartesian product of zero or more domains.
> 
> For those of us who went to school a while ago, and perhaps didn't pay 
> as much attention in math class as we should have, could you translate 
> "an element of the Cartesian product of zero or more domains" into 
> English?

The Cartesian product of X and Y is the set [(x, y) for x in X for y in Y].



More information about the Python-list mailing list