3 ms·
In python3 something like: def start(env, lines): while lines: line, *lines = lines if len(line) > 4 and line.startswith("+
by sampo 12y ago
In python3 something like:
def start(env, lines):
while lines:
line, *lines = lines
if len(line) > 4 and line.startswith("+++"):
header(env, line)
modified(env, 0, lines)
Notes:
while lines:
is pythonic for
while not lines == []:
- sampo 12y agoCorrection (I forgot the break): def start(env, lines): while lines: line, *lines = lines if len(line) > 4 and line.startswith("+++"): header(env, line) modified(env, 0, lines) break