[Numpy-discussion] np.{bool,float,int} deprecation

Robert Kern robert.kern at gmail.com
Fri Dec 11 14:01:01 EST 2020


On Fri, Dec 11, 2020 at 1:12 PM Aaron Meurer <asmeurer at gmail.com> wrote:

> On Fri, Dec 11, 2020 at 1:47 AM Eric Wieser <wieser.eric+numpy at gmail.com>
> wrote:
> >
> > >  you might want to discuss this with us at the array API standard
> > > https://github.com/data-apis/array-api (which is currently in RFC
> > > stage). The spec uses bool as the name for the boolean dtype.
> >
> > I don't fully understand this argument - `np.bool` is already not the
> boolean dtype. Either:
>
> The spec does deviate from what NumPy currently does in some places.
> If we wanted to just copy NumPy exactly, there wouldn't be a need for
> a specification.


I wouldn't take that as a premise. Specifying a subset of the vast existing
NumPy API would be a quite valuable specification in its own right. I find
the motivation for deviation laid out in the Purpose and Scope
<https://data-apis.github.io/array-api/latest/purpose_and_scope.html#introduction>
section
to be reasonably convincing that deviation might be needed *somewhere*. The
question then is, is *this* deviation supporting that stated motivation, or
is it taking the opportunity of a redesign to rationalize the names more to
our current tastes? Given the mode of adopting the standard (a separate
subpackage), that's a reasonable choice to make, but let's be clear about
the motivation. I submit that keeping the name `bool_` does not make it any
harder for other array APIs to adopt the standard. It's just that few
people would design a new API with that name if they were designing a
greenfield API.

-- 
Robert Kern
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/numpy-discussion/attachments/20201211/6c31361a/attachment-0001.html>


More information about the NumPy-Discussion mailing list