Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _iter_value_t = TypeVar('_iter_value_t')
- def filtered_enum(things: Iterable[_iter_value_t], mask: Iterable[bool], start: int = 0) -> Iterable[Tuple[int, _iter_value_t]]:
- return ((i, v) for (i, (v, mb)) in enumerate(zip(things, mask), start) if mb)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement