summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2022-07-05 11:49:54 -0700
committerScott Gasch <[email protected]>2022-07-05 11:49:54 -0700
commit562a15c6397610cf93646d9530005eb4a0d6e6f8 (patch)
treea1d6ef651439d71d573644e44196fcf7e037b8f2
parentd54d91ddfb14821ce1e1d878a96faec090ff31b9 (diff)
Update docs.
-rw-r--r--iter_utils.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/iter_utils.py b/iter_utils.py
index 85c2749..69f5822 100644
--- a/iter_utils.py
+++ b/iter_utils.py
@@ -17,9 +17,9 @@ from typing import Any, List, Optional
class PeekingIterator(Iterator):
- """An iterator that lets you :method:`peek` at the next item on deck.
+ """An iterator that lets you peek() at the next item on deck.
Returns None when there is no next item (i.e. when
- :method:`__next__` will produce a StopIteration exception).
+ __next__() will produce a StopIteration exception).
>>> p = PeekingIterator(iter(range(3)))
>>> p.__next__()
@@ -113,11 +113,13 @@ class SamplingIterator(Iterator):
collects a random sample (of size sample_size) of the stream that can
be queried at any time.
- Note that until sample_size elements have been seen the sample will
- be less than sample_size elements in length.
+ .. note::
+ Until sample_size elements have been seen the sample will be
+ less than sample_size elements in length.
- Note that if sample_size is > len(source_iter) then it will produce
- a copy of source_iter.
+ .. note::
+ If sample_size is > len(source_iter) then it will produce a
+ copy of source_iter.
>>> import collections
>>> import random