indent of very first line of doc string (was Re: [Doc-SIG] Some random
Edward Welbourne
Edward Welbourne <eddyw@lsl.co.uk>
Mon, 6 Mar 2000 13:29:05 +0000
> for i in range(1, len(lines)): lines[i] = lines[i][margin:]
Hmm. Mightn't it be a good idea to strip up to margin spaces off the
start of the first line also ? e.g.
""" Someone left a blank at the start of the string.
And then documented the rest."""
->
"""Someone left a blank at the start of the string.
And then documented the rest."""
and I'd rather compute
margin = min(map(lambda line: len(line) - len(lstrip(line)),
filter(lstrip, lines[1:]))) # ignore blank lines
so that the blank line in my doc-string doesn't force a margin of 0.
Eddy.