Some thougts on cartesian products

Steven D'Aprano steve at REMOVETHIScyber.com.au
Sun Jan 22 14:00:05 EST 2006


On Sun, 22 Jan 2006 10:41:39 -0800, Alex Martelli wrote:

> Steven D'Aprano <steve at REMOVETHIScyber.com.au> wrote:
>    ...
>> What advantage is there to creating a "list with cartesian product"
>> subclass of list?
> 
> Essentially, syntax sugar -- for some people, being able to code a*b
> rather than product(a,b) takes on a huge significance; Python chooses to
> support this syntax variation by special methods in classes, and thus
> encourages people to create classes if they're keen on the syntax.

I beg to differ: Python *allows* people to create classes if they're keen
on the syntax (and I can sympathise with that like), but Python
*encourages* by example generic tools that operate on as many different
types as makes sense.


-- 
Steven.




More information about the Python-list mailing list