Re: consistency: extending arrays vs. multiplication ?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: consistency: extending arrays vs. multiplication ?

From: Soeren Sonnenburg <python-ml@nn7.de>
Date: Sun Jul 24 2005 - 16:24:28 CEST

On Sun, 2005-07-24 at 13:36 +1000, Steven D'Aprano wrote:
> On Sat, 23 Jul 2005 18:30:02 +0200, Soeren Sonnenburg wrote:
>
> > Hi all,
> >
> > Just having started with python, I feel that simple array operations '*'
> > and '+' don't do multiplication/addition but instead extend/join an
> > array:
>
> * and + are not array operations, they are list operations.
>
> Lists in Python can contain anything, not just numeric values.

That seems to be *the point*. Although list(a) + list(b) could create a
list [ a[0]+b[0], ...] and bail out if for elements '+' is not
defined...

> Python doesn't have built-in mathematical arrays, otherwise known as
> matrices. There are modules that do that, but I haven't used them. Google
> on Numeric Python.

Well I am aware of that but I don't understand the reasons of having
both lists (which are infect arrays) and *arrays ? *I* would rather drop
'+' and '*' to work like they do in *array ...

Soeren
Received on Thu Sep 29 17:08:26 2005