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

This commit is contained in:
Guido van Rossum 2003-03-06 13:09:09 +00:00
parent 259d3d5784
commit e05dcce686
1 changed files with 1 additions and 1 deletions

View File

@ -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.