[Numpy-discussion] defmatrix.sum

Robert Kern robert.kern at gmail.com
Tue Jan 9 02:58:54 EST 2007

Stefan van der Walt wrote:
> Hi all,
> I noticed that Tim Leslie picked up on the out=None in defmatrix.sum:
>     def sum(self, axis=None, dtype=None, out=None):
>         """Sum the matrix over the given axis.  If the axis is None, sum
>         over all dimensions.  This preserves the orientation of the
>         result as a row or column.
>         """
>         return N.ndarray.sum(self, axis, dtype, out=None)._align(axis)
> Surely, that out=None should just be out? 


> If out is specified, should
> sum() still return a value?

Yes. Everything else with an out= parameter does.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

More information about the NumPy-Discussion mailing list