Open
Description
Also reported upstream at https://bugs.python.org/issue37980
With numpy 1.17.1 and python37 the following does not warn
sorted([1, 2], reverse=np.bool_(True))
but with py38
In [2]: sorted([1, 2], reverse=np.bool_(True))
<ipython-input-2-6726f33270df>:1: DeprecationWarning: In future, it will be an error for 'np.bool_' scalars to be interpreted as an index
sorted([1, 2], reverse=np.bool_(True))
Out[2]: [2, 1]
This bisects to python/cpython#11952 which use __index__
in more places which is tripping the deprecation in a surprising place.
sorted([1, 2], reverse=bool(np.bool_(True)))
Works in all cases.
amueller and rth
Metadata
Metadata
Assignees
Labels
No labels