get next iterator without incrementing python

38

from more_itertools import peekable

p = peekable(['a', 'b'])
p.peek()
# 'a'
next(p)
# 'a'
p.peek()
# 'b'

Comments

Submit
0 Comments