mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Replace for-yield-loop by "yield from"
This commit is contained in:
parent
3f90794f22
commit
2aa9e5ed3a
@ -418,8 +418,7 @@ class StandaloneHTMLBuilder(Builder):
|
||||
buildinfo = BuildInfo.load(fp)
|
||||
|
||||
if self.build_info != buildinfo:
|
||||
for docname in self.env.found_docs:
|
||||
yield docname
|
||||
yield from self.env.found_docs
|
||||
return
|
||||
except ValueError as exc:
|
||||
logger.warning(__('Failed to read build info file: %r'), exc)
|
||||
|
@ -3845,9 +3845,8 @@ class Symbol:
|
||||
yield c
|
||||
if not c.identOrOp.is_anon():
|
||||
continue
|
||||
# TODO: change to 'yield from' when Python 2 support is dropped
|
||||
for nested in c.children_recurse_anon:
|
||||
yield nested
|
||||
|
||||
yield from c.children_recurse_anon
|
||||
|
||||
def get_lookup_key(self):
|
||||
# type: () -> List[Tuple[ASTNestedNameElement, Any]]
|
||||
|
@ -458,8 +458,7 @@ class Documenter:
|
||||
self.env.app.emit('autodoc-process-docstring',
|
||||
self.objtype, self.fullname, self.object,
|
||||
self.options, docstringlines)
|
||||
for line in docstringlines:
|
||||
yield line
|
||||
yield from docstringlines
|
||||
|
||||
def get_sourcename(self):
|
||||
# type: () -> unicode
|
||||
|
@ -667,8 +667,7 @@ def status_iterator(iterable, summary, color="darkgreen", length=0, verbosity=0,
|
||||
stringify_func=display_chunk):
|
||||
# type: (Iterable, unicode, str, int, int, Callable[[Any], unicode]) -> Iterable # NOQA
|
||||
if length == 0:
|
||||
for item in old_status_iterator(iterable, summary, color, stringify_func):
|
||||
yield item
|
||||
yield from old_status_iterator(iterable, summary, color, stringify_func)
|
||||
return
|
||||
l = 0
|
||||
summary = bold(summary)
|
||||
|
@ -926,8 +926,7 @@ class LaTeXTranslator(SphinxTranslator):
|
||||
if isinstance(c, addnodes.start_of_file):
|
||||
continue
|
||||
elif isinstance(c, nodes.Element):
|
||||
for k in footnotes_under(c):
|
||||
yield k
|
||||
yield from footnotes_under(c)
|
||||
|
||||
fnotes = {} # type: Dict[unicode, List[Union[collected_footnote, bool]]]
|
||||
for fn in footnotes_under(node):
|
||||
|
@ -535,8 +535,7 @@ class TexinfoTranslator(SphinxTranslator):
|
||||
if isinstance(c, addnodes.start_of_file):
|
||||
continue
|
||||
elif isinstance(c, nodes.Element):
|
||||
for k in footnotes_under(c):
|
||||
yield k
|
||||
yield from footnotes_under(c)
|
||||
fnotes = {} # type: Dict[unicode, List[Union[collected_footnote, bool]]]
|
||||
for fn in footnotes_under(node):
|
||||
label = cast(nodes.label, fn[0])
|
||||
|
Loading…
Reference in New Issue
Block a user