Arnaud Delobelle <arno...@gmail.com> writes: > On 15 March 2012 22:35, Ben Finney <ben+pyt...@benfinney.id.au> wrote: > > I agree, and am glad PEP 8 has been updated to recommend an extra > > level of indentation for continuation, to distinguish from the new > > block that follows > > <URL:http://www.python.org/dev/peps/pep-0008/#indentation>. > > Personally I solve this by never writing if conditions that span more > than one line.
The admonition applies not only to ‘if’ conditions, but also to ‘while’, ‘with’, ‘for’, etc.; and also to bracketing constructs like function calls, literal lists/dicts/sets, etc. In a single statement, the indentation for continuation lines should be indented two levels, so that they don't look so much like a new block of statements. -- \ “If you do not trust the source do not use this program.” | `\ —Microsoft Vista security dialogue | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list