MAINT: Simpler impl of pad_lines_after_first.

This commit is contained in:
Scott Sanderson
2016-08-22 13:14:31 -04:00
parent d52ff04626
commit ae121ec1dc
+1 -8
View File
@@ -19,16 +19,9 @@ PIPELINE_DOWNSAMPLING_FREQUENCY_DOC = dedent(
)
def _gen_for_pad_lines_after_first(prefix, s):
lines = iter(s.splitlines())
yield next(lines)
for line in lines:
yield prefix + line
def pad_lines_after_first(prefix, s):
"""Apply a prefix to each line in s after the first."""
return '\n'.join(_gen_for_pad_lines_after_first(prefix, s))
return ('\n' + prefix).join(s.splitlines())
def format_docstring(owner_name, docstring, formatters):