summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2017-02-10 10:52:07 -0700
committerGitHub <noreply@github.com>2017-02-10 10:52:07 -0700
commit1b877254af0850d025cdc5d07b3fcaa1614dbe4b (patch)
tree8c16bd152cf3328515bd9502c19b0ca369d12d45 /doc
parentb52be49a702862a44f18237c5a9a6c7f5173ddab (diff)
parent5e3fb00b37f5b1c752f6f44c5717b2d84ee7daff (diff)
downloadnumpy-1b877254af0850d025cdc5d07b3fcaa1614dbe4b.tar.gz
Merge pull request #8592 from eric-wieser/remove-setslice
MAINT: Remove __setslice__ and __getslice__
Diffstat (limited to 'doc')
-rw-r--r--doc/release/1.13.0-notes.rst11
-rw-r--r--doc/source/reference/arrays.indexing.rst4
-rw-r--r--doc/source/reference/arrays.ndarray.rst2
-rw-r--r--doc/source/reference/maskedarray.baseclass.rst2
4 files changed, 13 insertions, 6 deletions
diff --git a/doc/release/1.13.0-notes.rst b/doc/release/1.13.0-notes.rst
index ac4d4b2c1..c70568821 100644
--- a/doc/release/1.13.0-notes.rst
+++ b/doc/release/1.13.0-notes.rst
@@ -65,6 +65,17 @@ implement ``__len__`` as the number of record fields, ``bool`` of scalar dtypes
would evaluate to ``False``, which was unintuitive. Now ``bool(dtype) == True``
for all dtypes.
+``__getslice__`` and ``__setslice__`` have been removed from ``ndarray``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+When subclassing np.ndarray in Python 2.7, it is no longer _necessary_ to
+implement ``__*slice__`` on the derived class, as ``__*item__`` will intercept
+these calls correctly.
+
+Any code that did implement these will work exactly as before, with the
+obvious exception of any code that tries to directly call
+``ndarray.__getslice__`` (e.g. through ``super(...).__getslice__``). In
+this case, ``.__getitem__(slice(start, end))`` will act as a replacement.
+
C API
~~~~~
diff --git a/doc/source/reference/arrays.indexing.rst b/doc/source/reference/arrays.indexing.rst
index b7bc3a655..6a5f428da 100644
--- a/doc/source/reference/arrays.indexing.rst
+++ b/doc/source/reference/arrays.indexing.rst
@@ -36,8 +36,8 @@ objects, the :const:`Ellipsis` object, or the :const:`newaxis` object,
but not for integer arrays or other embedded sequences.
.. index::
- triple: ndarray; special methods; getslice
- triple: ndarray; special methods; setslice
+ triple: ndarray; special methods; getitem
+ triple: ndarray; special methods; setitem
single: ellipsis
single: newaxis
diff --git a/doc/source/reference/arrays.ndarray.rst b/doc/source/reference/arrays.ndarray.rst
index f57fb0728..4c8bbf66d 100644
--- a/doc/source/reference/arrays.ndarray.rst
+++ b/doc/source/reference/arrays.ndarray.rst
@@ -595,8 +595,6 @@ Container customization: (see :ref:`Indexing <arrays.indexing>`)
ndarray.__len__
ndarray.__getitem__
ndarray.__setitem__
- ndarray.__getslice__
- ndarray.__setslice__
ndarray.__contains__
Conversion; the operations :func:`complex()`, :func:`int()`,
diff --git a/doc/source/reference/maskedarray.baseclass.rst b/doc/source/reference/maskedarray.baseclass.rst
index a1c90a45d..f35b0ea88 100644
--- a/doc/source/reference/maskedarray.baseclass.rst
+++ b/doc/source/reference/maskedarray.baseclass.rst
@@ -417,8 +417,6 @@ Container customization: (see :ref:`Indexing <arrays.indexing>`)
MaskedArray.__getitem__
MaskedArray.__setitem__
MaskedArray.__delitem__
- MaskedArray.__getslice__
- MaskedArray.__setslice__
MaskedArray.__contains__