Guido sees the light: PEP 8 updated

Chris Angelico rosuav at gmail.com
Tue Apr 19 10:13:00 EDT 2016


On Wed, Apr 20, 2016 at 12:05 AM, Random832 <random832 at fastmail.com> wrote:
> Source file contains:
> ### Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam
> ### ut mattis leo. In sed arcu gravida, consequat tellus placerat,
> ### ullamcorper metus.
> if foo:
>     if bar:
>         do stuff
> ###
> some other stuff
>
> (the last ### is just an empty comment to push stuff after it down past
> the first comment - if another comment is there instead, it will be
> displayed starting from the "some other stuff" line)
>
> Displays as:
>
> if foo:           # Lorem ipsum dolor sit amet, consectetur
>     if bar:       # adipiscing elit. Etiam ut mattis leo. In sed
>         do stuff  # arcu gravida, consequat tellus
>                   # placerat, ullamcorper metus.
>
> some other stuff

Why does it need to be displayed to the right, though? Do we gain
anything by not having the comment above the code?

ChrisA



More information about the Python-list mailing list