MCPcopy Create free account
hub / github.com/Notgnoshi/generative / triplewise

Function triplewise

generative/lsystem/grammar.py:38–44  ·  view source on GitHub ↗

Iterate over the given iterable in triples.

(iterable)

Source from the content-addressed store, hash-verified

36
37
38def triplewise(iterable):
39 """Iterate over the given iterable in triples."""
40 a, b, c = itertools.tee(iterable, 3)
41 next(b, None)
42 next(c, None)
43 next(c, None)
44 return zip(a, b, c)
45
46
47class LSystemGrammar:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected