Raise a RuntimeError when tee iterator is consumed from different threads (GH-15567)

This commit is contained in:
HongWeipeng 2019-08-29 11:39:25 +08:00 committed by Raymond Hettinger
parent 13f37f2ba8
commit fa220ec763
3 changed files with 12 additions and 1 deletions

View file

@ -643,7 +643,8 @@ loops that truncate the stream.
Once :func:`tee` has made a split, the original *iterable* should not be
used anywhere else; otherwise, the *iterable* could get advanced without
the tee objects being informed.
the tee objects being informed. the :func:`tee` iterator can not be consumed
from different threads, even if an underlying iterator is thread-safe.
This itertool may require significant auxiliary storage (depending on how
much temporary data needs to be stored). In general, if one iterator uses