mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-24 15:13:03 +02:00
add peekable docstrings
This commit is contained in:
@@ -3,6 +3,10 @@ from collections import deque
|
|||||||
_marker = object()
|
_marker = object()
|
||||||
|
|
||||||
class Peekable(object):
|
class Peekable(object):
|
||||||
|
"""Peekable version of a normal python generator.
|
||||||
|
Useful when you don't want to evaluate the entire iterable to look at
|
||||||
|
a specific item at a given idx.
|
||||||
|
"""
|
||||||
def __init__(self, iterable):
|
def __init__(self, iterable):
|
||||||
self._it = iter(iterable)
|
self._it = iter(iterable)
|
||||||
self._cache = deque()
|
self._cache = deque()
|
||||||
|
Reference in New Issue
Block a user