summaryrefslogtreecommitdiffstats
path: root/Lib/timeit.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-03-06 13:09:09 (GMT)
committerGuido van Rossum <guido@python.org>2003-03-06 13:09:09 (GMT)
commite05dcce686692d0078792a1a542d889bd2ef91f5 (patch)
tree023e48fdaf9e1b929752bba9b1aa027d8067d12c /Lib/timeit.py
parent259d3d5784d0f812db5d22eff52616db01472db9 (diff)
downloadcpython-e05dcce686692d0078792a1a542d889bd2ef91f5.zip
cpython-e05dcce686692d0078792a1a542d889bd2ef91f5.tar.gz
cpython-e05dcce686692d0078792a1a542d889bd2ef91f5.tar.bz2
Simpler way to write reindent(), suggested by Raymond H.
Diffstat (limited to 'Lib/timeit.py')
-rw-r--r--Lib/timeit.py2
1 files changed, 1 insertions, 1 deletions
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 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.