[Numpy-discussion] align `choices` and `sample` with Python `random` module

Ralf Gommers ralf.gommers at gmail.com
Mon Dec 10 12:20:12 EST 2018


On Mon, Dec 10, 2018 at 8:27 AM Alan Isaac <alan.isaac at gmail.com> wrote:

> On 12/10/2018 11:20 AM, Ralf Gommers wrote:
> > there is nothing wrong with the current API
>
> Just to be clear: you completely reject the past
> cautions on this list against creating APIs
> with flag parameters.  Is that correct?
>

There's no such caution in general. There are particular cases of keyword
arguments that behave in certain ways that are best avoided in the future,
for example `full_output=False` to return extra arguments. In this case,
the `replace` keyword just switches between two methods, which seems
perfectly normal to me.

Either way, even things like `full_output` are not a good reason to
deprecate something. We deprecate things because they're buggy, have severe
usability issues, or some similar reason that translates to user pain.

Cheers,
Ralf



>
> Or is "nothing wrong" just a narrow approval in
> this particular case?
>
> Alan Isaac
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20181210/9499b0ad/attachment.html>


More information about the NumPy-Discussion mailing list