mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-34410: Fix a crash in the tee iterator when re-enter it. (GH-15625)
RuntimeError is now raised in this case.
This commit is contained in:
parent
918b468b7d
commit
526a01467b
4 changed files with 52 additions and 0 deletions
|
@ -645,6 +645,10 @@ loops that truncate the stream.
|
|||
used anywhere else; otherwise, the *iterable* could get advanced without
|
||||
the tee objects being informed.
|
||||
|
||||
``tee`` iterators are not threadsafe. A :exc:`RuntimeError` may be
|
||||
raised when using simultaneously iterators returned by the same :func:`tee`
|
||||
call, even if the original *iterable* is threadsafe.
|
||||
|
||||
This itertool may require significant auxiliary storage (depending on how
|
||||
much temporary data needs to be stored). In general, if one iterator uses
|
||||
most or all of the data before another iterator starts, it is faster to use
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue