API: Hide exceptions from the main namespace#22735
Merged
mattip merged 2 commits intonumpy:mainfrom Dec 7, 2022
Merged
Conversation
Member
|
Hiding but not yet deprecating seems right to me. |
Member
Author
|
Ah, I should follow up with a scan for changing the current uses at least in documentation, and also internal uses. But maybe its actually nice to keep it as distinct PRs. |
9abad96 to
c6c3aa6
Compare
I wasn't sure if we should already start deprecating the exceptions so opted to follow up with only hiding them from `__dir__()` but still having them in `__all__` and available. This also changes their module to `numpy.exceptions`, which matters because that is how they will be pickled (it would not be possible to unpickle such an exception in an older NumPy version). Due to pickling, we could put off changing the module.
c6c3aa6 to
928a7b4
Compare
mattip
reviewed
Dec 6, 2022
80dc7c8 to
2ac75e5
Compare
Member
|
Thanks @seberg |
seberg
added a commit
to seberg/numpy
that referenced
this pull request
Dec 13, 2022
The first one should have been removed in numpygh-22735, the second an even more random find.
rossbar
pushed a commit
that referenced
this pull request
Dec 13, 2022
The first one should have been removed in gh-22735, the second an even more random find.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I wasn't sure if we should already start deprecating the exceptions so opted to follow up with only hiding them from
__dir__()but still having them in__all__and available.This also changes their module to
numpy.exceptions, which matters because that is how they will be pickled (it would not be possible to unpickle such an exception in an older NumPy version).Due to pickling, we could put off changing the module.