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