Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!news.glorb.com!news.astraweb.com!border6.newsrouter.astraweb.com!not-for-mail From: Ben Finney Newsgroups: comp.lang.python Subject: Re: PEP 8 and indentation of continuation lines References: X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney Date: Tue, 21 Jun 2011 15:22:52 +1000 Message-ID: <87k4cfpxlf.fsf@benfinney.id.au> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:ESuhsxCIcPz0xFVNYoMQqX65k4U= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Lines: 30 Organization: Unlimited download news at news.astraweb.com NNTP-Posting-Host: 35903c5e.news.astraweb.com X-Trace: DXC=LgiO3WNiN9X7mQFj[jV^?kWSbEW9A[5UK?UNZ[SL`C\KgSP]oGWSbK?YW Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:8072 John Yeung writes: > So last week PEP 8 was updated to reflect this. All fine and good. I > happen to prefer this style myself. But there remains an example > further down (left over from earlier incarnations of PEP 8) which > might go against this: > > if (width == 0 and height == 0 and > color == 'red' and emphasis == 'strong' or > highlight > 100): > raise ValueError("sorry, you lose") > > The above satisfies the "opening paren" alignment, but due to the > length of the keyword, the suite is obscured. For this example, > should PEP 8 use the double-indentation for the continuation lines? I wrote some code just today that needs the above issue addressed. I did it like this:: if ( width == 0 and height == 0 and color == 'red' and emphasis == 'strong' or highlight > 100): raise ValueError("sorry, you lose") -- \ “I'm a great lover, I'll bet.” —Emo Philips | `\ | _o__) | Ben Finney