From e441c291b2e10c8de85a9d950d0add552d0ebd83 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Fri, 16 Feb 2018 21:36:38 -0800 Subject: MAINT: Stop using non-tuple indices internally By not using this type of indexing, it becomes easier for subclasses to override indexing in a way that works correctly with numpy functions. These locations were found by deprecating the behavior in question, which is deliberately not part of this commit --- numpy/lib/arraypad.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'numpy/lib/arraypad.py') diff --git a/numpy/lib/arraypad.py b/numpy/lib/arraypad.py index cdc354a02..daaa68d06 100644 --- a/numpy/lib/arraypad.py +++ b/numpy/lib/arraypad.py @@ -1346,9 +1346,9 @@ def pad(array, pad_width, mode, **kwargs): # Create a new padded array rank = list(range(narray.ndim)) total_dim_increase = [np.sum(pad_width[i]) for i in rank] - offset_slices = [slice(pad_width[i][0], - pad_width[i][0] + narray.shape[i]) - for i in rank] + offset_slices = tuple( + slice(pad_width[i][0], pad_width[i][0] + narray.shape[i]) + for i in rank) new_shape = np.array(narray.shape) + total_dim_increase newmat = np.zeros(new_shape, narray.dtype) -- cgit v1.2.1