On Wed, 2020-08-19 at 19:37 -0600, Aaron Meurer wrote: > These cases don't give any deprecation warnings in NumPy master: > > > > > np.arange(0)[np.array([0]), False] > array([], dtype=int64) > > > > np.arange(0).reshape((0, 0))[np.array([0]), np.array([], > > > > dtype=int)] > array([], dtype=int64) > > Is that intentional?
I guess it follows from `np.array([[1]])[[], [10]]` also not failing currently. And that was intentional not to deprecate when out-of-bound indices broadcast away. But I am not sure I actually think that was the better choice. My initial choice was that this would be an error as well, and I still slightly prefer it, but don't feel it matters much. - Sebastian > > Aaron Meurer > > On Thu, Jul 23, 2020 at 12:18 PM Aaron Meurer <asmeu...@gmail.com> > wrote: > > > After writing this, I realized that I actually remember the > > > *opposite* > > > discussion occurring before. I think in some of the equality > > > deprecations, we actually raise the new error due to an internal > > > try/except clause. And there was a complaint that its confusing > > > that a > > > non-deprecation-warning is raised when the error will only happen > > > with > > > DeprecationWarnings being set to error. > > > > > > - Sebastian > > > > I noticed that warnings.catch_warnings does the right thing with > > warnings that are raised alongside an exception (although it is a > > bit > > clunky to use). > > > > Aaron Meurer > _______________________________________________ > NumPy-Discussion mailing list > NumPy-Discussion@python.org > https://mail.python.org/mailman/listinfo/numpy-discussion >
signature.asc
Description: This is a digitally signed message part
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion