Looking for indent advice howto in emacs python-mode

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Mar 31 22:17:47 EDT 2008


En Mon, 31 Mar 2008 16:36:13 -0300, bruno.desthuilliers at gmail.com  
<bruno.desthuilliers at gmail.com> escribió:

> On 31 mar, 18:32, "Steven W. Orr" <ste... at syslang.net> wrote:
>> Here's what I want to do:
>>
>> if ( ( v == 1 )
>>    or ( v == 2 )
>>    or ( v == 3 ) ):
>>      pass
>
> Why the parens ?
>
> if a == 1 \
>    or b == 2 \
>    or c == 3:
>     pass

I know it's mostly a matter of style, but I prefer to add parenthesis and  
avoid line continuation characters. Sometimes I use parenthesis for  
strings too, when multiline strings are not a good choice:

txt = ("En un lugar de "
        "la Mancha, de cuyo "
        "nombre no quiero "
        "acordarme, no ha "
        "mucho tiempo...")

(A multiline string would keep the inner \n but in this case I don't want  
that)

-- 
Gabriel Genellina




More information about the Python-list mailing list