diff options
| author | Scott Gasch <[email protected]> | 2022-07-05 12:02:22 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2022-07-05 12:02:22 -0700 |
| commit | e106f3e4aa1e038cd52ea966a961c2493ab56096 (patch) | |
| tree | 1ce9edde1d9e5456667a351c0dd45721d86329d7 /iter_utils.py | |
| parent | 562a15c6397610cf93646d9530005eb4a0d6e6f8 (diff) | |
Use an overtly named method on SamplingIterator.
Diffstat (limited to 'iter_utils.py')
| -rw-r--r-- | iter_utils.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/iter_utils.py b/iter_utils.py index 69f5822..8cd204d 100644 --- a/iter_utils.py +++ b/iter_utils.py @@ -132,13 +132,13 @@ class SamplingIterator(Iterator): >>> s.__next__() 1 - >>> s() + >>> s.get_sample() [0, 1] >>> collections.deque(s) deque([2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99]) - >>> s() + >>> s.get_sample() [78, 18, 47, 83, 93, 26, 25, 73, 94, 38] """ @@ -173,7 +173,7 @@ class SamplingIterator(Iterator): self.resovoir[r] = item return item - def __call__(self) -> List[Any]: + def get_sample(self) -> List[Any]: return self.resovoir |
