Python indentation

Josef Meile jmeile at hotmail.com
Fri Jul 9 12:38:06 EDT 2004


> Well, one could apply another coding style in this example:
> 
> if (condition) {
>   doThis();
>   doThat();
> } else {
>   doWhatever();
>   andSoOn();
> }
I don't like that style. I think it's better to have the if and else at 
the same level. ie:

if (condition) {
   doThis();
   doThat();
}
else {
   doWhatever();
   andSoOn();
}

Anyway, it's a matter of style :-)

> 
> which only takes 7 lines and is not much less readable. But I agree with
> you!
I also agree. I love the fact that you can't produce bad indented code 
in python

Regards,
Josef



More information about the Python-list mailing list