Skip to content

Commit e34d926

Browse files
document buffer sharing
1 parent 3306fad commit e34d926

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

asyncstdlib/itertools.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def __del__(self) -> None:
411411

412412
@public_module(__name__, "tee")
413413
class Tee(Generic[T]):
414-
"""
414+
r"""
415415
Create ``n`` separate asynchronous iterators over ``iterable``
416416
417417
This splits a single ``iterable`` into multiple iterators, each providing
@@ -433,8 +433,9 @@ async def derivative(sensor_data):
433433
if the most and least advanced iterator differ by most data,
434434
using a :py:class:`list` is more efficient (but not lazy).
435435
436-
If ``iterable`` is an iterator and read elsewhere, ``tee`` will *not*
437-
provide these items.
436+
If ``iterable`` is an iterator and read elsewhere, ``tee`` will generally *not*
437+
provide these items. However, a ``tee`` of a ``tee`` shares its buffer with parent,
438+
sibling and child ``tee``\ s so that each sees the same items.
438439
439440
If the underlying iterable is concurrency safe (``anext`` may be awaited
440441
concurrently) the resulting iterators are concurrency safe as well. Otherwise,

0 commit comments

Comments
 (0)