Enable py::ellipsis on Python 2 (#2360)

* Enable py::ellipsis on Python 2

* Enable py::ellipsis tests on Python 2 and mention `Ellipsis` in the docs
This commit is contained in:
Yannick Jadoul
2020-08-04 14:45:55 +02:00
committed by GitHub
parent 1caf1d0613
commit 3e448c0b5e
4 changed files with 5 additions and 10 deletions

View File

@@ -371,6 +371,8 @@ Ellipsis
Python 3 provides a convenient ``...`` ellipsis notation that is often used to
slice multidimensional arrays. For instance, the following snippet extracts the
middle dimensions of a tensor with the first and last index set to zero.
In Python 2, the syntactic sugar ``...`` is not available, but the singleton
``Ellipsis`` (of type ``ellipsis``) can still be used directly.
.. code-block:: python