(self, unit: str, amount: int = 1)
| 288 | return separator.join(parts) |
| 289 | |
| 290 | def range(self, unit: str, amount: int = 1) -> Iterator[_T]: |
| 291 | method = "add" |
| 292 | op = operator.le |
| 293 | if not self._absolute and self.invert: |
| 294 | method = "subtract" |
| 295 | op = operator.ge |
| 296 | |
| 297 | start, end = self.start, self.end |
| 298 | |
| 299 | i = amount |
| 300 | while op(start, end): |
| 301 | yield start |
| 302 | |
| 303 | start = getattr(self.start, method)(**{unit: i}) |
| 304 | |
| 305 | i += amount |
| 306 | |
| 307 | def as_duration(self) -> Duration: |
| 308 | """ |
no outgoing calls