diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2015-10-15 19:29:55 +0300 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2015-10-15 19:29:55 +0300 |
commit | 39c8565ac1a8d16d6c0e4b2c2507ef141383942f (patch) | |
tree | f4ed55c3a96d2571d010592254e4426bf44ae498 | |
parent | bad5bf1ef5bab02ad09e1e8a736aaf47c75b6602 (diff) | |
download | pylint-39c8565ac1a8d16d6c0e4b2c2507ef141383942f.tar.gz |
Simplify the code a little bit by using enumerate instead of a range and len combination.
-rw-r--r-- | pylint/reporters/ureports/text_writer.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/pylint/reporters/ureports/text_writer.py b/pylint/reporters/ureports/text_writer.py index c3014bd..3693ad6 100644 --- a/pylint/reporters/ureports/text_writer.py +++ b/pylint/reporters/ureports/text_writer.py @@ -89,13 +89,12 @@ class TextWriter(BaseWriter): headsep = u'\n+' + u'+'.join([u'='*w for w in cols_width]) + u'+\n' # FIXME: layout.cheaders self.write(table_linesep) - for i in range(len(table_content)): + for index, line in enumerate(table_content): self.write(u'|') - line = table_content[i] - for j in range(len(line)): - self.write(format_strings[j] % line[j]) + for line_index, at_index in enumerate(line): + self.write(format_strings[line_index] % at_index) self.write(u'|') - if i == 0 and layout.rheaders: + if index == 0 and layout.rheaders: self.write(headsep) else: self.write(table_linesep) |