New submission from Thomas Caswell <tcasw...@gmail.com>:

In python37, numpy1.17 the following runs without warning.

import numpy as np
sorted([1, 2], reverse=np.bool_(True))  

with python38 this emits a

DeprecationWarning: In future, it will be an error for 'np.bool_' scalars to be 
interpreted as an index

I bisected this back to https://github.com/python/cpython/pull/11952 which 
looks very intentional, however it is tripping deprecation warnings in numpy to 
prevent things like `[1, 2, 3][np.bool_(False), np.bool_(True)]` from doing 
surprising things.

I have previously gotten the sense that core would like to know about these 
sorts of regressions rather than just handling them down-stream.  I will be 
opening an issue with numpy as well.

----------
files: numpy_warning_bisect.log
messages: 350800
nosy: tcaswell
priority: normal
severity: normal
status: open
title: regression when passing numpy bools to sorted(..., reverse=r)
versions: Python 3.8
Added file: https://bugs.python.org/file48568/numpy_warning_bisect.log

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37980>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to