File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -323,8 +323,8 @@ Sequences also support slicing: ``a[start:stop]`` selects all items with index *
323323that *start * ``<= `` *k * ``< `` *stop *. When used as an expression, a slice is a
324324sequence of the same type. The comment above about negative subscripts also applies
325325to negative slice positions.
326- Note that no error is raised if a slice positions is larger than the length
327- of the sequence.
326+ Note that no error is raised if a slice position is less than zero or larger
327+ than the length of the sequence.
328328
329329If *start * is missing or ``None ``, slicing behaves as if *start * was zero.
330330If *stop * is missing or ``None ``, slicing behaves as if *stop * was equal to
Original file line number Diff line number Diff line change @@ -1120,10 +1120,7 @@ Formal subscription grammar
11201120 subscript: `slice ` | `tuple_slices `
11211121 tuple_slices: ','.(`slice ` | `starred_expression `)+ [',']
11221122 slice: `proper_slice ` | `assignment_expression `
1123- proper_slice: [`lower_bound `] ":" [`upper_bound `] [ ":" [`stride `] ]
1124- lower_bound: `expression `
1125- upper_bound: `expression `
1126- stride: `expression `
1123+ proper_slice: [`expression `] ":" [`expression `] [ ":" [`expression `] ]
11271124
11281125There is a semantic difference between the alternatives for *subscript *.
11291126If *subscript * contains ony one unstarred *slice * without a trailing comma,
You can’t perform that action at this time.
0 commit comments