diff options
author | Michael W. Hudson <mwh@python.net> | 2002-06-11 10:55:12 (GMT) |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2002-06-11 10:55:12 (GMT) |
commit | 5efaf7eac8c1dbbf82a96dc5d9b87fddd5d17b58 (patch) | |
tree | 7358a0479ab98893ad5a5457ae0df328d0e60251 /Doc/ref | |
parent | f90ae20354ceb501f0ba0b6459df17f1a8005a47 (diff) | |
download | cpython-5efaf7eac8c1dbbf82a96dc5d9b87fddd5d17b58.zip cpython-5efaf7eac8c1dbbf82a96dc5d9b87fddd5d17b58.tar.gz cpython-5efaf7eac8c1dbbf82a96dc5d9b87fddd5d17b58.tar.bz2 |
This is my nearly two year old patch
[ 400998 ] experimental support for extended slicing on lists
somewhat spruced up and better tested than it was when I wrote it.
Includes docs & tests. The whatsnew section needs expanding, and arrays
should support extended slices -- later.
Diffstat (limited to 'Doc/ref')
-rw-r--r-- | Doc/ref/ref3.tex | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/ref/ref3.tex b/Doc/ref/ref3.tex index 2eb5739..c319fb8 100644 --- a/Doc/ref/ref3.tex +++ b/Doc/ref/ref3.tex @@ -252,6 +252,13 @@ sequence of the same type. This implies that the index set is renumbered so that it starts at 0. \index{slicing} +Some sequences also support ``extended slicing'' with a third ``step'' +parameter: \code{\var{a}[\var{i}:\var{j}:\var{k}]} selects all items +of \var{a} with index \var{x} where \code{\var{x} = \var{i} + +\var{n}*\var{k}}, \var{n} \code{>=} \code{0} and \var{i} \code{<=} +\var{x} \code{<} \var{j}. +\index{extended slicing} + Sequences are distinguished according to their mutability: \begin{description} |