[Python-Dev] pep8 reasoning

Florent florent.xicluna at gmail.com
Sun Apr 27 22:32:44 CEST 2014


2014-04-27 21:34 GMT+02:00 Chris Barker <chris.barker at noaa.gov>:
>
> wow! just looked at that part of the PEP again, and that is a LOT of
> options. Is it impossible to come to any consensus on this? And as it
> happens, my favorite is not in there, though as far as I can tell not
> forbidden:
>
> foo = long_function_name(var_one,
>                                            var_two,
>                                            var_three,
>                                            var_four)
>
>
> Anyway -- is there a point in trying to standardize this a bit more in PEP8,
> or has that battle long since been fought and conceded ?
>

FWIW, the tool pep8 has introduced continuation line indentation
checks in 2012, based on the PEP 8 recommendations which were active
at this date, and doing few extrapolations on cases which were not
directly covered by the document (pep8.py v1.2, issue #64).

Then we had a lot of iterations with the users of the library, and
we've added more flexibility to cover the various styles which were in
the spirit of PEP 8, and which give some added value for code
readability.

The end result of this work can be seen in the test suite :
 * more than 300 lines of rejected indentations:
    https://github.com/jcrocholl/pep8/blob/master/testsuite/E12.py
* and more than 600 lines of acceptable cases:
    https://github.com/jcrocholl/pep8/blob/master/testsuite/E12not.py

I don't think that the PEP 8 document should go in so much details, though.
However these examples might help to have pragmatic discussions about
which rules we want to recommend.

Do not hesitate to give feedback here, or on the issue tracker.
There's also a code-quality mailing-list which covers a little more
than pep8.py:
https://mail.python.org/mailman/listinfo/code-quality

-- 
Florent


More information about the Python-Dev mailing list