diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-08-15 08:26:36 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-08-15 08:26:36 -0400 |
commit | db235732dd9a0198f6e5d00b895baa516221fee2 (patch) | |
tree | 478b50037f9fdbef2fc570c3dbad899987518bfa /coverage/sqldata.py | |
parent | f6d3e88ba5b2dab1720281885c99cdf3ce2844bc (diff) | |
download | python-coveragepy-git-db235732dd9a0198f6e5d00b895baa516221fee2.tar.gz |
refactor: use sets to collect data
Coverage.py predates sets as a built-in data structure, so the file data
collection has long been dicts with None as the values. Sets are
available to us now (since Python 2.4 in 2004, which coverage.py dropped
support for in 2014!), we use sets.
Diffstat (limited to 'coverage/sqldata.py')
-rw-r--r-- | coverage/sqldata.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/coverage/sqldata.py b/coverage/sqldata.py index db3ab73a..3fe5317e 100644 --- a/coverage/sqldata.py +++ b/coverage/sqldata.py @@ -450,9 +450,9 @@ class CoverageData(SimpleReprMixin): def add_lines(self, line_data): """Add measured line data. - `line_data` is a dictionary mapping file names to dictionaries:: + `line_data` is a dictionary mapping file names to iterables of ints:: - { filename: { lineno: None, ... }, ...} + { filename: { line1, line2, ... }, ...} """ if self._debug.should('dataop'): @@ -483,9 +483,10 @@ class CoverageData(SimpleReprMixin): def add_arcs(self, arc_data): """Add measured arc data. - `arc_data` is a dictionary mapping file names to dictionaries:: + `arc_data` is a dictionary mapping file names to iterables of pairs of + ints:: - { filename: { (l1,l2): None, ... }, ...} + { filename: { (l1,l2), (l1,l2), ... }, ...} """ if self._debug.should('dataop'): |