3 ms·
0. Only 2 of 3 values are necessary. 1. Can 1 value be unspecified? 2. Can 2 values be unspecified? 3. Can 3 values be unspecified? 4. Are conflicting value
by sacnoradhq 4y ago
0. Only 2 of 3 values are necessary.
1. Can 1 value be unspecified?
2. Can 2 values be unspecified?
3. Can 3 values be unspecified?
4. Are conflicting values interpreted as intersection of ranges rather than union?
Note 1-3. With 2 values, I believe x[:] is how to lift a sized array into a more generic slice type.
- masklinn 4y agoYour questions are really unclear. In the 2-parameters form `a[low:high]`, both values can be left out, defaulting to respectively 0 and len(a). In the 3-parameter form, only the leading value can be left out, defaulting to 0. I've no idea what (4) is asking about.
- klodolph 4y agoRegarding conflicting ranges— In a[i:j:k], 0 <= i, i <= j, j <= k, and k <= cap(a). If not, then the operation will panic.