Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #8074

Re: PEP 8 and indentation of continuation lines

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.alt.net!news.astraweb.com!border6.newsrouter.astraweb.com!not-for-mail
From Ben Finney <ben+python@benfinney.id.au>
Newsgroups comp.lang.python
Subject Re: PEP 8 and indentation of continuation lines
References <eb561969-9ab7-4da5-8be9-dacbc9409bc6@t9g2000vbv.googlegroups.com> <87k4cfpxlf.fsf@benfinney.id.au>
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 <bignose+hates-spam@benfinney.id.au>
Date Tue, 21 Jun 2011 15:39:09 +1000
Message-ID <87fwn3pwua.fsf@benfinney.id.au> (permalink)
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)
Cancel-Lock sha1:VHX7bkAG3w8VphpA65faP8pT74I=
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
Lines 35
Organization Unlimited download news at news.astraweb.com
NNTP-Posting-Host 35903c5e.news.astraweb.com
X-Trace DXC=4jP_3YiRc2EMnc]O[a9m]EL?0kYOcDh@J7^o:UA4R?cEKQMXQnOdekJ]G;2>V^?kWCbEW9A[5UK?ENZ[SL`C\KgCX]efPI:_OjJ
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:8074

Show key headers only | View raw


Ben Finney <ben+python@benfinney.id.au> writes:

> John Yeung <gallium.arsenide@gmail.com> 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::

The formatting was messed up. Since the whitespace is the whole point
here, this is what I intended to send::

    if (
            width == 0 and height == 0 and
            color == 'red' and emphasis == 'strong' or
            highlight > 100):
        raise ValueError("sorry, you lose")

-- 
 \      “The process by which banks create money is so simple that the |
  `\     mind is repelled.” —John Kenneth Galbraith, _Money: Whence It |
_o__)                                       Came, Where It Went_, 1975 |
Ben Finney

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

PEP 8 and indentation of continuation lines John Yeung <gallium.arsenide@gmail.com> - 2011-06-20 21:11 -0700
  Re: PEP 8 and indentation of continuation lines Ben Finney <ben+python@benfinney.id.au> - 2011-06-21 15:22 +1000
    Re: PEP 8 and indentation of continuation lines Ben Finney <ben+python@benfinney.id.au> - 2011-06-21 15:39 +1000

csiph-web