Commits

Ned Batchelder committed 7b48529

Convert the last of the document-style comments to a docstring.

Comments (0)

Files changed (2)

     + Use sets instead of dicts
 - Get rid of the recursive nonsense.
 - Docstrings.
-- Remove huge document-style comments.
++ Remove huge document-style comments.
 + Remove singleton
     + Initialization of instance variables in the class.
 - Better names:

coverage/control.py

         self.analysis_cache[code_unit.filename] = result
         return result
 
-    # 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, so if statements =
-    # [1,2,3,4,5,10,11,12,13,14] and lines = [1,2,5,10,11,13,14] then
-    # format_lines will return "1-2, 5-11, 13-14".
+    def format_lines(self, statements, lines):
+        """Nicely format a list of line numbers.
 
-    def format_lines(self, 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
         j = 0
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.