diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2019-09-09 08:47:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-09 08:47:14 (GMT) |
commit | 526a01467b3277f9fcf7f91e66c23321caa1245d (patch) | |
tree | 57d20cb52a4cd5e78a59403e278418908e9cd5a7 /Doc/library | |
parent | 918b468b7d5ebf1ec5e604cb0d99605cee38d983 (diff) | |
download | cpython-526a01467b3277f9fcf7f91e66c23321caa1245d.zip cpython-526a01467b3277f9fcf7f91e66c23321caa1245d.tar.gz cpython-526a01467b3277f9fcf7f91e66c23321caa1245d.tar.bz2 |
bpo-34410: Fix a crash in the tee iterator when re-enter it. (GH-15625)
RuntimeError is now raised in this case.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/itertools.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index a3f403a..8d134d4 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -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 |