Re: [Numpy-discussion] Use of booleans in slices

2020-08-14 Thread Sebastian Berg
This is because slicing with a boolean has just no confusing meaning I can think of [1]. NumPy even used to reject it, but there seems no reason to add maintenance/code complexity (i.e. duplicate code from Python already provides) to reject bools. There used to be a reason to using `__index__()` i

[Numpy-discussion] Use of booleans in slices

2020-08-13 Thread Aaron Meurer
I noticed that np.bool_.__index__() gives a DeprecationWarning >>> np.bool_(True).__index__() __main__:1: DeprecationWarning: In future, it will be an error for 'np.bool_' scalars to be interpreted as an index 1 This is good, because booleans don't actually act like integers in indexing contexts.