Message17873
Section 2.2.6 (Sequence types), note 5 from the table
says:
"The slice of s from i to j with step k is defined as the
sequence of items with index x = i + n*k such that 0
<= n < abs(i-j). [...]"
However, n should only range up to (j-i)//k
Note also that (j-i)//k correctly specifies the results for
negative values of k, and empty sequence returns
where signof(j-i) != signof (k). Maybe worth mentioning
that k != 0 (!! :-) |
|
Date |
User |
Action |
Args |
2007-08-23 14:16:17 | admin | link | issue792656 messages |
2007-08-23 14:16:17 | admin | create | |
|