Skip to content

Commit 68aa560

Browse files
Slice variables naming consistency.
First index is *i*, then *k*, and then *x*, why?
1 parent d242baf commit 68aa560

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Doc/reference/datamodel.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,14 +315,14 @@ but ``a[-n-1]`` doesn't exit.
315315

316316
.. index:: single: slicing
317317

318-
Sequences also support slicing: ``a[i:j]`` selects all items with index *k* such
319-
that *i* ``<=`` *k* ``<`` *j*. When used as an expression, a slice is a
318+
Sequences also support slicing: ``a[start:stop]`` selects all items with index
319+
*i* such that ``start <= i < stop``. When used as an expression, a slice is a
320320
sequence of the same type. The comment above about negative indexes also applies
321321
to negative slice positions.
322322

323-
Some sequences also support "extended slicing" with a third "step" parameter:
324-
``a[i:j:k]`` selects all items of *a* with index *x* where ``x = i + n*k``, *n*
325-
``>=`` ``0`` and *i* ``<=`` *x* ``<`` *j*.
323+
Some sequences also support "extended slicing" with a third *step* parameter:
324+
``a[start:stop:step]`` selects all items of *a* with index *i* where
325+
``i = start + n*step``, ``n >= 0`` and ``start <= i < stop``.
326326

327327
Sequences are distinguished according to their mutability:
328328

0 commit comments

Comments
 (0)