mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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.
This commit is contained in:
parent
f90ae20354
commit
5efaf7eac8
13 changed files with 570 additions and 22 deletions
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue