summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorHongWeipeng <961365124@qq.com>2019-08-29 03:39:25 (GMT)
committerRaymond Hettinger <rhettinger@users.noreply.github.com>2019-08-29 03:39:25 (GMT)
commitfa220ec7633e9674baccc28dde987f29d7f65141 (patch)
tree065b6b1b6cadd563ba6e357217318404b6cedc43 /Doc/library
parent13f37f2ba8b1fa39f312dca920e847d9c0313c77 (diff)
downloadcpython-fa220ec7633e9674baccc28dde987f29d7f65141.zip
cpython-fa220ec7633e9674baccc28dde987f29d7f65141.tar.gz
cpython-fa220ec7633e9674baccc28dde987f29d7f65141.tar.bz2
Raise a RuntimeError when tee iterator is consumed from different threads (GH-15567)
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/itertools.rst3
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst
index a3f403a..8e7899e 100644
--- a/Doc/library/itertools.rst
+++ b/Doc/library/itertools.rst
@@ -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