diff options
author | Daniel Eades <danieleades@hotmail.com> | 2022-01-10 12:21:53 +0300 |
---|---|---|
committer | Daniel Eades <danieleades@hotmail.com> | 2022-01-12 23:19:18 +0300 |
commit | 6697ed62ed38287b72dd6ff213ba41d9d8f86466 (patch) | |
tree | ea61d054d85df6215dd3a8e42294e2c3ead60269 /sphinx/writers | |
parent | 49196d44746f7dd84dcc3a1837bd5c8d68a9848e (diff) |
address some unused loop control variables (B007)
Diffstat (limited to 'sphinx/writers')
-rw-r--r-- | sphinx/writers/latex.py | 4 | ||||
-rw-r--r-- | sphinx/writers/texinfo.py | 10 | ||||
-rw-r--r-- | sphinx/writers/text.py | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index 46f736f3f..0e95317d2 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -1508,7 +1508,7 @@ class LaTeXTranslator(SphinxTranslator): if not node.get('inline', True): self.body.append(CR) entries = node['entries'] - for type, string, tid, ismain, key_ in entries: + for type, string, _tid, ismain, _key in entries: m = '' if ismain: m = '|spxpagem' @@ -1976,7 +1976,7 @@ class LaTeXTranslator(SphinxTranslator): def depart_container(self, node: Element) -> None: classes = node.get('classes', []) - for c in classes: + for _c in classes: self.body.append('\n\\end{sphinxuseclass}') def visit_decoration(self, node: Element) -> None: diff --git a/sphinx/writers/texinfo.py b/sphinx/writers/texinfo.py index 351aef2f7..47f61e9b7 100644 --- a/sphinx/writers/texinfo.py +++ b/sphinx/writers/texinfo.py @@ -312,7 +312,7 @@ class TexinfoTranslator(SphinxTranslator): del node_menus[top['node_name']] top['node_name'] = 'Top' # handle the indices - for name, content in self.indices: + for name, _content in self.indices: node_menus[name] = [] node_menus['Top'].append(name) @@ -320,7 +320,7 @@ class TexinfoTranslator(SphinxTranslator): """Collect the relative links (next, previous, up) for each "node".""" rellinks = self.rellinks node_menus = self.node_menus - for id, entries in node_menus.items(): + for id in node_menus.keys(): rellinks[id] = ['', '', ''] # up's for id, entries in node_menus.items(): @@ -466,7 +466,7 @@ class TexinfoTranslator(SphinxTranslator): def collect_indices(self) -> None: def generate(content: List[Tuple[str, List[IndexEntry]]], collapsed: bool) -> str: ret = ['\n@menu\n'] - for letter, entries in content: + for _letter, entries in content: for entry in entries: if not entry[3]: continue @@ -1018,7 +1018,7 @@ class TexinfoTranslator(SphinxTranslator): if len(self.colwidths) != self.n_cols: return self.body.append('\n\n@multitable ') - for i, n in enumerate(self.colwidths): + for n in self.colwidths: self.body.append('{%s} ' % ('x' * (n + 2))) def depart_colspec(self, node: Element) -> None: @@ -1054,7 +1054,7 @@ class TexinfoTranslator(SphinxTranslator): self.entry_sep = '@tab' def depart_entry(self, node: Element) -> None: - for i in range(node.get('morecols', 0)): + for _i in range(node.get('morecols', 0)): self.body.append('\n@tab\n') # -- Field Lists diff --git a/sphinx/writers/text.py b/sphinx/writers/text.py index 2e1dd474a..9fef050c1 100644 --- a/sphinx/writers/text.py +++ b/sphinx/writers/text.py @@ -167,8 +167,8 @@ class Table: @property def cells(self) -> Generator[Cell, None, None]: seen: Set[Cell] = set() - for lineno, line in enumerate(self.lines): - for colno, cell in enumerate(line): + for line in self.lines: + for cell in line: if cell and cell not in seen: yield cell seen.add(cell) |