Replace Nones in slices with integers >>> normalize_slice(slice(None, None, None)) slice(0, None, 1)
(s)
| 188 | |
| 189 | |
| 190 | def normalize_slice(s): |
| 191 | """Replace Nones in slices with integers |
| 192 | |
| 193 | >>> normalize_slice(slice(None, None, None)) |
| 194 | slice(0, None, 1) |
| 195 | """ |
| 196 | start, stop, step = s.start, s.stop, s.step |
| 197 | if start is None: |
| 198 | start = 0 |
| 199 | if step is None: |
| 200 | step = 1 |
| 201 | if start < 0 or step < 0 or stop is not None and stop < 0: |
| 202 | raise NotImplementedError() |
| 203 | return slice(start, stop, step) |
| 204 | |
| 205 | |
| 206 | def check_for_nonfusible_fancy_indexing(fancy, normal): |
no outgoing calls
no test coverage detected
searching dependent graphs…