Alex Martelli wrote:
> Kay Schluehr <[EMAIL PROTECTED]> wrote:
>> range(3)**2
>> But why isn't this interpreted as [0, 1, 4] like it is in Mathematica?
> 
> Since range(3)*2 is [0, 1, 2, 0, 1, 2], it would be horribly, painfully
> inconsistent if **2 was interpreted as "square each item".

Yes. Python does not interpreate the product of a list with a number as 
a scalar product. Otherwise range(3)*2 should be [0, 1, 4] as well.

For doing such things I would use a vector subtype of list.

-- Christoph
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to