(self, other)
| 1317 | |
| 1318 | @unpack_zerodim_and_defer("__floordiv__") |
| 1319 | def __floordiv__(self, other): |
| 1320 | if is_integer(other) and other != 0: |
| 1321 | if len(self) == 0 or (self.start % other == 0 and self.step % other == 0): |
| 1322 | start = self.start // other |
| 1323 | step = self.step // other |
| 1324 | stop = start + len(self) * step |
| 1325 | new_range = range(start, stop, step or 1) |
| 1326 | return self._simple_new(new_range, name=self._name) |
| 1327 | if len(self) == 1: |
| 1328 | start = self.start // other |
| 1329 | new_range = range(start, start + 1, 1) |
| 1330 | return self._simple_new(new_range, name=self._name) |
| 1331 | |
| 1332 | return super().__floordiv__(other) |
| 1333 | |
| 1334 | # -------------------------------------------------------------------- |
| 1335 | # Reductions |
nothing calls this directly
no test coverage detected