Skip to content

Commit d242baf

Browse files
Length is added to negative index only once.
1 parent 2d67688 commit d242baf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Doc/reference/datamodel.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ built-in function :func:`len` returns the number of items of a sequence. When
310310
the length of a sequence is *n*, the index set contains the numbers 0, 1,
311311
..., *n*-1. Item *i* of sequence *a* is selected by ``a[i]``. Most sequences,
312312
including built-in sequences, interpret negative subscripts by adding the
313-
sequence length. For example, ``a[-1]`` is the last item (``a[n-1]``).
313+
sequence length (once). For example, ``a[-1]`` is the last item (``a[n-1]``),
314+
but ``a[-n-1]`` doesn't exit.
314315

315316
.. index:: single: slicing
316317

0 commit comments

Comments
 (0)