Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #103898
| From | Peter Otten <__peter__@web.de> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Continuing indentation |
| Date | 2016-03-02 22:27 +0100 |
| Organization | None |
| Message-ID | <mailman.116.1456954063.20602.python-list@python.org> (permalink) |
| References | <CANc-5Uz=mG6r9uw94tizxUh7eT=ftB1+z6d5nwzhDC=8+6YV1w@mail.gmail.com> |
Skip Montanaro wrote: > 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. In this particular case, the overall conditions > are too long to string together on a single line. I tried placing a > second space after the if keyword: > > if (some_condition and > some_other_condition and > some_final_condition): > play_bingo() > > which solves the matching indentation problem, but creates a multiple > spaces after keyword problem. My guess is that adding a space after > the open paren would provoke a message as well. > > 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? Manually inspecting the output of $ cd /usr/lib/python3.4 $ find . -name \*.py -print0 | xargs -0 egrep 'if \([^:]+$' --color -A3 [...] gives the impression that those who do care are a minority and that the most common workaround is an extra indent of four spaces.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Continuing indentation Peter Otten <__peter__@web.de> - 2016-03-02 22:27 +0100
csiph-web