[issue37980] regression when passing numpy bools to sorted(..., reverse=r)

Mark Dickinson report at bugs.python.org
Fri Aug 30 08:16:11 EDT 2019


Mark Dickinson <dickinsm at gmail.com> added the comment:

Victor

> The purpose of the DeprecationWarning is to give time to numpy developers to update the bool_() type, before it becomes an error.

No, that's not what's happening: currently, np.bool_ *does* support __index__. In the future, it won't. The NumPy developers are deliberately removing __index__ from np.bool_, for reasons described in the relevant NumPy issues. The DeprecationWarning is coming from NumPy, not Python. See https://github.com/numpy/numpy/pull/9685

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37980>
_______________________________________


More information about the Python-bugs-list mailing list