summaryrefslogtreecommitdiff
path: root/coverage/misc.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-12-03 08:54:27 -0500
committerNed Batchelder <ned@nedbatchelder.com>2009-12-03 08:54:27 -0500
commit5f7375fb90aaf728ebf6c9da9a61b5302dcbd71b (patch)
tree60f4c9265e686d2685c1a10d4a4acdff04ef7f79 /coverage/misc.py
parente0b2014fad18f284256c94422d940ceb84e8be24 (diff)
parent99a3e92e89c3e9d4a0dd73ae71b0b849d7fddbee (diff)
downloadpython-coveragepy-5f7375fb90aaf728ebf6c9da9a61b5302dcbd71b.tar.gz
Merged default onto config.
Diffstat (limited to 'coverage/misc.py')
-rw-r--r--coverage/misc.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/coverage/misc.py b/coverage/misc.py
index aa61fc9..0e6bcf9 100644
--- a/coverage/misc.py
+++ b/coverage/misc.py
@@ -2,10 +2,10 @@
def nice_pair(pair):
"""Make a nice string representation of a pair of numbers.
-
+
If the numbers are equal, just return the number, otherwise return the pair
with a dash between them, indicating the range.
-
+
"""
start, end = pair
if start == end:
@@ -20,10 +20,10 @@ def format_lines(statements, lines):
Format a list of line numbers for printing by coalescing groups of lines as
long as the lines represent consecutive statements. This will coalesce
even if there are gaps between statements.
-
+
For example, if `statements` is [1,2,3,4,5,10,11,12,13,14] and
`lines` is [1,2,5,10,11,13,14] then the result will be "1-2, 5-11, 13-14".
-
+
"""
pairs = []
i = 0
@@ -47,9 +47,9 @@ def format_lines(statements, lines):
def expensive(fn):
"""A decorator to cache the result of an expensive operation.
-
+
Only applies to methods with no arguments.
-
+
"""
attr = "_cache_" + fn.__name__
def _wrapped(self):