Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update np.bool to be an alias to np.bool_ and un-deprecate it #22021

Closed
@rgommers

Description

@rgommers

Since NumPy 1.20.0, np.bool is deprecated (together with np.int and np.float). We'd like to keep np.bool though, because it's a better name than np.bool_ and is unambiguous.

There was a long email thread on this topic: https://mail.python.org/archives/list/[email protected]/thread/NZWX22G5L7I5LOMKQ7HIRECUZXV6NA34/#NZWX22G5L7I5LOMKQ7HIRECUZXV6NA34. The approach @seberg suggested there was:

  1. Go ahead for now (deprecate)
  2. Add a FutureWarning at some point that we will start to export np.bool again (but from numpy import * is a problem?)
  3. Aim to make np.bool is np.bool_ at some point in the (far) future.

np.bool has now been deprecated for four releases, so it's time to take the next step in the next release (1.24.0).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions