Returns the first value from iterable, as well as a new iterator with the same content as the original iterable
(iterable: Iterable[T])
| 280 | |
| 281 | |
| 282 | def peek_at(iterable: Iterable[T]) -> tuple[T, Iterator[T]]: |
| 283 | """Returns the first value from iterable, as well as a new iterator with |
| 284 | the same content as the original iterable |
| 285 | """ |
| 286 | gen = iter(iterable) |
| 287 | peek = next(gen) |
| 288 | return peek, itertools.chain([peek], gen) |
| 289 | |
| 290 | |
| 291 | def update_safety_check( |
no outgoing calls
no test coverage detected
searching dependent graphs…