diff options
| author | Ian Cordasco <graffatcolmingov@gmail.com> | 2017-05-27 22:54:55 +0000 |
|---|---|---|
| committer | Ian Cordasco <graffatcolmingov@gmail.com> | 2017-05-27 22:54:55 +0000 |
| commit | ec5405d2a8287022fd50f456385e2eaefa663c3e (patch) | |
| tree | 3c139c56182e4638fbcd1505bca6b439d4e435a5 /src/flake8/statistics.py | |
| parent | d890b8b6833689aa0a67abb8f406082f4dd8ad81 (diff) | |
| parent | db4f71288e02acc97b59389414ab2cec794436c7 (diff) | |
| download | flake8-ec5405d2a8287022fd50f456385e2eaefa663c3e.tar.gz | |
Merge branch 'keys' into 'master'
Prefer iter(dict) instead of dict.keys()
See merge request !186
Diffstat (limited to 'src/flake8/statistics.py')
| -rw-r--r-- | src/flake8/statistics.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/flake8/statistics.py b/src/flake8/statistics.py index 45a7eb1..d555df2 100644 --- a/src/flake8/statistics.py +++ b/src/flake8/statistics.py @@ -17,7 +17,7 @@ class Statistics(object): :rtype: list(str) """ - return sorted({key.code for key in self._store.keys()}) + return sorted({key.code for key in self._store}) def record(self, error): """Add the fact that the error was seen in the file. @@ -55,7 +55,7 @@ class Statistics(object): :returns: Generator of instances of :class:`Statistic` """ - matching_errors = sorted(key for key in self._store.keys() + matching_errors = sorted(key for key in self._store if key.matches(prefix, filename)) for error_code in matching_errors: yield self._store[error_code] |
