8000 DOC: Change to `np.bool` not mentioned in the migration guide · Issue #26203 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

DOC: Change to np.bool not mentioned in the migration guide #26203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jorenham opened this issue Apr 3, 2024 · 8 comments
Closed

DOC: Change to np.bool not mentioned in the migration guide #26203

jorenham opened this issue Apr 3, 2024 · 8 comments

Comments

@jorenham
Copy link
Member
jorenham commented Apr 3, 2024

Issue with current documentation:

The changes to np.bool are mentioned in the 2.0.0 release notes, but I can't find anything about it in the migration guide, even though it's a breaking change.

related to #26199

Idea or request for content:

No response

@rgommers
Copy link
Member
rgommers commented Apr 3, 2024

It's not a breaking change; np.bool does not exist in numpy 1.24-1.26

@jorenham
Copy link
Member Author
jorenham commented Apr 3, 2024

@rgommers Oh I must've missed that then, I was under the impression that np.bool was an alias to builtins.bool

@rgommers
Copy link
Member
rgommers commented Apr 3, 2024

yes, long ago - that was deprecated in 1.20.0 and then removed in 1.24.0. It's noted in the 1.24.0 release notes as a breaking change.

@rgommers rgommers closed this as not planned Won't fix, can't repro, duplicate, stale Apr 3, 2024
@jorenham
Copy link
Member Author
jorenham commented Apr 3, 2024

Either way, shouldn't this still be in the migration guide, since np.bool_ is but a temporary alias?

@rgommers
Copy link
Member
rgommers commented Apr 3, 2024

Not really, since (as you found out) it's hard to use np.bool now unless you drop 1.x support. It's easier to use regular docs and (now or later) drop the np.bool_ type annotation as a nudge. Users who already use bool_ right now don't have to do anything right now; new users looking for it will find np.bool first since it's more discoverable.

@jorenham
Copy link
Member Author
jorenham commented Apr 3, 2024

A wise man said in #25080 (comment) that

We should keep that for quite a while, in order to not force people to write if/else stuff depending on the numpy version. In the long run it can go, but there is no hurry I think.

Which in my mind falls into the category of "deprecated, do not use". Or is this a miscategorization on my part?

@rgommers
Copy link
Member
rgommers commented Apr 3, 2024

More or less - "discouraged, do not use for new code" I'd say. At some point we'll probably deprecate it, and then it'll start emitting a warning, so if that's release 2.6.0 or so, it will end up in the notes for that release. "deprecated" has a very well-defined meaning (https://numpy.org/neps/nep-0023-backwards-compatibility.html), and will cause many downstream projects to have to migrate away from it straight away, since they turn warnings into errors in their CI.

@jorenham
Copy link
Member Author
jorenham commented Apr 3, 2024

Ok that clears things up, thanks 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0