Question
Implement a utility that turns one input iterable into `n` iterators. Every returned iterator must yield the full source sequence in order, and consumers may advance at different speeds. Read each source value only once, and do not eagerly materialize the entire source.
```python
class IndependentTee:
def __init__(self, iterable, n: int): ...
# expose or return n Python iterators
```
Raise `ValueError` when `n < 1`. Source exceptions and exhaustion should propagate consistently to every consumer. Concurrent calls are out of scope for the initial implementation.
Start with a correct design, then improve its memory usage so that buffered values are shared rather than copied into `n` independent queues. Space should be proportional to the distance between the fastest and slowest consumers plus per-consumer cursor state.
## Staged follow-ups
1. Explain when buffered values can safely be discarded.
2. Handle a consumer that is abandoned before reaching the end.
3. Make advancement thread-safe and discuss lock granularity.