@@ -16,7 +16,7 @@ use std::ops::{Deref, Range, RangeFrom, RangeFull, RangeInclusive, RangeTo, Rang
1616
1717/// A slice (range with step size).
1818///
19- /// `end` is an exclusive index. Negative `begin ` or `end` indexes are counted
19+ /// `end` is an exclusive index. Negative `start ` or `end` indexes are counted
2020/// from the back of the axis. If `end` is `None`, the slice extends to the end
2121/// of the axis.
2222///
@@ -36,8 +36,12 @@ use std::ops::{Deref, Range, RangeFrom, RangeFull, RangeInclusive, RangeTo, Rang
3636/// The Python equivalent is `[a::-1]`.
3737#[ derive( Copy , Clone , Debug , PartialEq , Eq , Hash ) ]
3838pub struct Slice {
39+ /// start index; negative are counted from the back of the axis
3940 pub start : isize ,
41+ /// end index; negative are counted from the back of the axis; when not present
42+ /// the default is the full length of the axis.
4043 pub end : Option < isize > ,
44+ /// step size in elements; the default is 1, for every element.
4145 pub step : isize ,
4246}
4347
@@ -105,12 +109,16 @@ pub struct NewAxis;
105109/// `[np.newaxis]`. The macro equivalent is `s![NewAxis]`.
106110#[ derive( Debug , PartialEq , Eq , Hash ) ]
107111pub enum SliceInfoElem {
108- /// A range with step size. `end` is an exclusive index. Negative `begin `
112+ /// A range with step size. `end` is an exclusive index. Negative `start `
109113 /// or `end` indexes are counted from the back of the axis. If `end` is
110114 /// `None`, the slice extends to the end of the axis.
111115 Slice {
116+ /// start index; negative are counted from the back of the axis
112117 start : isize ,
118+ /// end index; negative are counted from the back of the axis; when not present
119+ /// the default is the full length of the axis.
113120 end : Option < isize > ,
121+ /// step size in elements; the default is 1, for every element.
114122 step : isize ,
115123 } ,
116124 /// A single index.
0 commit comments