Kaydet (Commit) e05dcce6 authored tarafından Guido van Rossum's avatar Guido van Rossum

Simpler way to write reindent(), suggested by Raymond H.

üst 259d3d57
......@@ -84,7 +84,7 @@ def inner(number, timer):
def reindent(src, indent):
"""Helper to reindent a multi-line statement."""
return ("\n" + " "*indent).join(src.split("\n"))
return src.replace("\n", "\n" + " "*indent)
class Timer:
"""Class for timing execution speed of small code snippets.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment