[Tutor] Long Lines techniques

Mark Lawrence breamoreboy at gmail.com
Thu Dec 13 16:27:43 EST 2018


On 13/12/2018 19:33, Bob Gailer wrote:
> On Dec 13, 2018 1:51 PM, "Avi Gross" <avigross at verizon.net> wrote:
>>
>> Simple question:
> 
> Avi: when I see an email from you I tend to ignore it because it always
> seems to lead to something that is long, time consuming and complex. Would
> you consider finding ways to make your questions or comments a lot briefer?
> 
> I will be more inclined to read them if they are briefer.
> 
> You have correctly determined the conditions that will lead to continuation
> lines without backslash. I think we tend to use whatever is convenient.
> 
> In your example of a list comprehension over multiple lines there is no
> indentation. There is just a lot of white space. You might look at it this
> way: the compiler sees a left bracket with no corresponding right bracket
> on that line. So it assumes that there's more to the statement on the next
> line, it ignores the newline and just continues. Indentation is only
> significant if it starts at the beginning of a statement.
> 
> Hope this helps
> 
> Bob gailer
> 

Big +1 from me :-)

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence



More information about the Tutor mailing list