Peekable
Bases: ,
Represents the result of peeking into an Iter.
Inerhit from Checkable to provide truthiness based on whether any elements were peeked.
Attributes:
| Name | Type | Description |
|---|---|---|
|
|
A |
|
|
An |
See Also
Iter.peekable()
Iter.cloned()
Example:
>>> import pyochain as pc
>>> it = pc.Iter([1, 2, 3, 4, 5])
>>> peekable = it.peekable(3)
>>> peekable.peek
Seq(1, 2, 3)
>>> peekable.values.collect()
Seq(1, 2, 3, 4, 5)
Source code in src/pyochain/_iter.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
peek
instance-attribute
A Seq of the peeked elements.
values
instance-attribute
An Iter of values, still including the peeked elements.