[Numpy-discussion] `out` argument to ufuncs

Gael Varoquaux gael.varoquaux at normalesup.org
Thu Sep 4 09:32:18 EDT 2008


On Thu, Sep 04, 2008 at 05:24:53AM -0500, Robert Kern wrote:
> On Thu, Sep 4, 2008 at 05:01, Stéfan van der Walt <stefan at sun.ac.za> wrote:
> > 2008/9/4 Robert Kern <robert.kern at gmail.com>:
> >> I am confused. add() and subtract() *do* take an out argument.

Hum, good!

> > So it does.  We both tried a keyword-style argument, which I think is
> > a reasonable expectation?

> It would certainly be *nice*, but many C-implemented functions don't
> do this ('cause it's a pain in C). It's even harder to do for ufuncs;
> follow the chain of calls down from PyUFunc_GenericFunction().

> Hmm. Now that I look at it, it might be feasible to extract the out=
> keyword in construct_loop() and append it to the args tuple before
> passing that down to construct_arrays(). <push onto todo stack>

Cool. Either that, or fix'n the docs. I had a look at the docstring and
it wasn't hinted by the docstring. THe docstring editor is here for
fixing these details, but I think I'll simply wait for you to add the
keyword argument :).

Cheers,

Gaël



More information about the NumPy-Discussion mailing list