[Numpy-discussion] Fix to #789 maybe not right.

Charles R Harris charlesr.harris@gmail....
Wed May 21 23:26:27 CDT 2008

On Wed, May 21, 2008 at 8:56 PM, David Cournapeau <
david@ar.media.kyoto-u.ac.jp> wrote:

> Charles R Harris wrote:
> > David,
> >
> > I'm not sure that fix is completely correct. The out keyword is funny
> > and I'm not what the specs are supposed to be, but generally the
> > output is cast rather than an error raised.
> I think the out argument is one of this thing which is rather a mess
> right now in numpy. The functions which accept it do not always mention
> it, and as you say, there are various different behaviour.
> What are the uses of the out argument ? The obvious one is saving
> memory, but are there others ? Automatic casting would break the memory
> saving.

I've been contemplating this and I think you are right. The out parameter is
for those special bits that need efficiency and should be as simple as
possible. That means: same type and shape as the normal output, no appeal.
This is especially so as a reference to the output is what the function
returns when out is present and the return type should not depend on the
type of the out parameter.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080521/2d6b1021/attachment.html 

More information about the Numpy-discussion mailing list