MCPcopy Create free account
hub / github.com/webpy/webpy / peekable2

Class peekable2

web/template.py:352–363  ·  view source on GitHub ↗

A peekable class which caches the last item returned by next()

Source from the content-addressed store, hash-verified

350 )
351
352 class peekable2(peekable):
353 """
354 A peekable class which caches the last item returned by next()
355 """
356
357 def __init__(self, iterable):
358 super().__init__(iterable)
359 self.current_item = None
360
361 def __next__(self):
362 self.current_item = super().__next__()
363 return self.current_item
364
365 tokens = peekable2(get_tokens(text))
366

Callers 1

read_exprMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected