Skip to content

Commit b89d4e0

Browse files
committed
📝 Add tip for a stride of -1
1 parent c148c4a commit b89d4e0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/types/lists.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ Line 3
109109
Line 5
110110
A stride of ``-1`` reverses the order.
111111

112+
.. tip::
113+
To reverse the order, however, :func:`list.reverse` should be easier to
114+
read than a stride of ``-1``, see also :ref:`list.reverse() <reverse>`.
115+
112116
.. seealso::
113117
* :doc:`Select and filter data with pandas
114118
<Python4DataScience:workspace/pandas/select-filter>`
@@ -148,6 +152,8 @@ Line 11
148152
Some functions of the slice notation can also be executed with special
149153
operations, which improves the readability of the code:
150154

155+
.. _reverse:
156+
151157
.. code-block:: pycon
152158
:linenos:
153159

0 commit comments

Comments
 (0)