[Python-ideas] Minor tweak to PEP 8?
Mike Meyer
mwm at mired.org
Wed May 11 08:00:22 CEST 2011
On Wed, 11 May 2011 13:50:42 +1000
Ben Finney <ben+python at benfinney.id.au> wrote:
> "Carl M. Johnson"
> <cmjohnson.mailinglist at gmail.com> writes:
>
> > Can we all at least agree that continuation lines should always be at
> > least one space more indented than the parent line?
>
> At least one standard (four-column) indentation level further than the
> opening line.
Still overly strict. Consider:
f(long_named_argument_one, calculated_value_two(with_arguments),
another_argument)
The two-space indent is perfectly reasonable here, as it aligns the
first element (a function argument) with the same function's argument
above it. In some cases, a similar one-space indent is also
reasonable.
I stand by my second proposal (reworded):
Continuation lines should be indented to reflect the structure of
the code. The indentation should either align with similar elements
or match the surrounding source.
<mike
--
Mike Meyer <mwm at mired.org> http://www.mired.org/
Independent Software developer/SCM consultant, email for more information.
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
More information about the Python-ideas
mailing list