commit | e05dcce686692d0078792a1a542d889bd2ef91f5 | [log] [tgz] |
---|---|---|
author | Guido van Rossum <guido@python.org> | Thu Mar 06 13:09:09 2003 +0000 |
committer | Guido van Rossum <guido@python.org> | Thu Mar 06 13:09:09 2003 +0000 |
tree | 023e48fdaf9e1b929752bba9b1aa027d8067d12c | |
parent | 259d3d5784d0f812db5d22eff52616db01472db9 [diff] [blame] |
Simpler way to write reindent(), suggested by Raymond H.
diff --git a/Lib/timeit.py b/Lib/timeit.py index 3d1f300..4ed24de 100644 --- a/Lib/timeit.py +++ b/Lib/timeit.py
@@ -84,7 +84,7 @@ 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.