Commit 8532198e authored by Guido van Rossum's avatar Guido van Rossum

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

parent e6e05bd4
...@@ -84,7 +84,7 @@ def inner(number, timer): ...@@ -84,7 +84,7 @@ def inner(number, timer):
def reindent(src, indent): def reindent(src, indent):
"""Helper to reindent a multi-line statement.""" """Helper to reindent a multi-line statement."""
return ("\n" + " "*indent).join(src.split("\n")) return src.replace("\n", "\n" + " "*indent)
class Timer: class Timer:
"""Class for timing execution speed of small code snippets. """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