mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Raise a RuntimeError when tee iterator is consumed from different threads (GH-15567)
This commit is contained in:
parent
13f37f2ba8
commit
fa220ec763
3 changed files with 12 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue