Two-Dimensional Expression Layout

Lawrence D’Oliveiro lawrencedo99 at gmail.com
Sat Aug 20 19:44:50 EDT 2016


On Sunday, August 21, 2016 at 10:35:08 AM UTC+12, c... at zip.com.au wrote:
> Aye, but beware that the expression is actually correct for the
> indentation.  
> Compare:
> 
>    assert \
>        (
>            len(self.points) == 0
>        and
>                not self.points[0].off
>            or
>                (closed or not self.points[-1].off)
> 
> where the precedence causes the layout to mislead.

At least there is a discrepancy between the two to set alarm bells ringing.

Compare statement indentation, where Python got rid of the statement brackets, so there is no more redundancy to be checked.

Why do you think I put in those “#end” lines?



More information about the Python-list mailing list