Compare source code
Lawrence D'Oliveiro
ldo at geek-central.gen.new_zealand
Sun Nov 7 05:39:40 EST 2010
In message <8jftftFelnU1 at mid.individual.net>, Neil Cerutti wrote:
> The handsome ':' terminator of if/elif/if statements allows us to
> omit a newline, conserving vertical space. This improves the
> readability of certain constructs.
>
> if x: print(x)
> elif y: print(y)
> else: print()
I would never do that. “Conserving vertical space” seems a stupid reason for
doing it. In C, I even go the opposite way:
if (x)
{
printf(..., x);
}
else if (y)
{
printf(..., y);
}
else
{
printf(...);
} /*if*/
More information about the Python-list
mailing list