Skip to content

Commit 2d0d5d9

Browse files
committed
-
1 parent 780edf9 commit 2d0d5d9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

source_py3/python_toolbox/nifty_collections/lazy_tuple.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ def my_generator():
7575
Some actions require exhausting the entire iterator. For example, checking
7676
the `LazyTuple` length, or doing indexex access with a negative index.
7777
(e.g. asking for the seventh-to-last element.)
78+
79+
If you're passing in an iterator you definitely know to be infinite,
80+
specify `definitely_infinite=False`.
7881
'''
7982

8083
def __init__(self, iterable, definitely_infinite=False):
@@ -91,6 +94,12 @@ def __init__(self, iterable, definitely_infinite=False):
9194
'''The internal iterator from which we get data.'''
9295

9396
self.definitely_infinite = definitely_infinite
97+
'''
98+
The iterator is definitely infinite.
99+
100+
The iterator might still be infinite if this is `False`, but if it's
101+
`True` then it's definitely infinite.
102+
'''
94103

95104
self.lock = threading.Lock()
96105
'''Lock used while exhausting to make `LazyTuple` thread-safe.'''

0 commit comments

Comments
 (0)