[Numpy-discussion] Please chime in on proposed methods for arrays

Robert Kern rkern at ucsd.edu
Wed Mar 16 21:10:00 EST 2005

Travis Oliphant wrote:
> One item I have not received a lot of feedback on is the new proposal 
> for a greatly increased number of methods on the ndarray.
> The current PEP has a listing of all the proposed methods and attributes 
> (some more were added after consulting current numarray in more detail 
> and looking at all the functions in current Numeric.py)
> If a function call essentially involved an arrayobject with some other 
> parameters then it was turned into a method.  If it involved two "equal" 
> arrays then it was left as a function.  This is a somewhat arbitrary 
> convention, and so I am asking for suggestions as to what should be 
> methods.
> Should all the ufuncs be methods as well?  I think Konrad suggested 
> this.  What is the opinion of others?

I'm too lazy to search right now, but I'm pretty sure that Konrad 
suggested the opposite: that x.sin(), while possibly "cleaner" in an 
OO-fetishistic sense, jars too much against the expectation of sin(x) 
that all of us got accustomed to in math class. Maybe I should let him 
speak for himself, though.  :-)

I think the division you have listed in the PEP is a reasonable one.

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 NumPy-Discussion mailing list