[Numpy-discussion] Feedback on new argument positions for ma.dot and MaskedArray.dot

Charles R Harris charlesr.harris at gmail.com
Mon Nov 9 19:43:37 EST 2015

On Sun, Nov 8, 2015 at 8:43 PM, Nathaniel Smith <njs at pobox.com> wrote:

> On Nov 8, 2015 6:00 PM, "Eric Firing" <efiring at hawaii.edu> wrote:
> >
> > I also prefer that there be a single convention: either the "out" kwarg
> is the end of the every signature, or it is the first kwarg in every
> signature.  It's a very special and unusual kwarg, so it should have a
> standard location.
> For all ufuncs, out arguments come first immediately after in arguments,
> so +1 for doing that for consistency.

Agree that that is what to shoot for. The particular problem with `ma.dot`
is that it already has the `strict` argument where the new `out` argument
should go. I propose the following steps.

   1. For backward compatibility, start by adding new arguments to the end
   2. Later raise FutureWarning on positional arguments that are out of
   3. Then make all but early arguments keyword only

Once we have keyword only for a while, it would be possible to add some
arguments back as positional arguments, but it might be best to keep them
as keyword only as suggested above.

For the current PR, this means that the dot method will have positional
arguments in a different order than ma.dot. Alternatively, out could be
made keyword only in both, although that would require fixing up some
tests. There is really no magical solution that avoids all difficulties
that I can see.

Unless a consensus develops otherwise, I will pursue step 1. and go for a
1.10.2rc tomorrow.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20151109/c7ddc2ac/attachment.html>

More information about the NumPy-Discussion mailing list