Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #103899 > unrolled thread
| Started by | Ben Finney <ben+python@benfinney.id.au> |
|---|---|
| First post | 2016-03-03 08:29 +1100 |
| Last post | 2016-03-03 08:29 +1100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Continuing indentation Ben Finney <ben+python@benfinney.id.au> - 2016-03-03 08:29 +1100
| From | Ben Finney <ben+python@benfinney.id.au> |
|---|---|
| Date | 2016-03-03 08:29 +1100 |
| Subject | Re: Continuing indentation |
| Message-ID | <mailman.117.1456954179.20602.python-list@python.org> |
Skip Montanaro <skip.montanaro@gmail.com> writes:
> Running flake8 over some code which has if statements with multiple
> conditions like this:
>
> if (some_condition and
> some_other_condition and
> some_final_condition):
> play_bingo()
>
> the tool complains that the indentation of the conditions is the same
> as the next block.
For this reason I prefer to indent all continuation lines 8 spaces::
if (
some_condition and
some_other_condition and
some_final_condition):
play_bingo()
> I use GNU Emacs as my text editor, and its python mode. I'm pretty
> happy with everything (been using it in its current state for several
> years). Aside from manually or configure-ologically suppressing E129,
> is there a better way to break lines I'm missing which will make
> flake8 happy?
The style I recommend above is PEP 8 compliant, easy to read, remember,
and apply.
--
\ “This [Bush] Administration is not sinking. This Administration |
`\ is soaring. If anything they are rearranging the deck chairs on |
_o__) the Hindenburg.” —Steven Colbert, 2006-04-29 |
Ben Finney
Back to top | Article view | comp.lang.python
csiph-web