consistency: extending arrays vs. multiplication ?

Robert Kern rkern at ucsd.edu
Sat Jul 23 15:15:16 EDT 2005


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:
> 
> a=[1,2,3]

This isn't an array. It is a list. If you want an array, use 
Numeric/numarray. If you want lists, use lists. Lists will never grow 
the kind of behavior you're asking for.

-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter




More information about the Python-list mailing list