[Python-Dev] PEP 7 clarification request: braces (original) (raw)
Petri Lehtinen petri at digip.org
Mon Jan 2 14:24:28 CET 2012
- Previous message: [Python-Dev] PEP 7 clarification request: braces
- Next message: [Python-Dev] PEP 7 clarification request: braces
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Antoine Pitrou wrote:
I don't like having the else on the same line as the closing brace, and prefer:
if (cond) { statement; } else { statement; }
And this is how it's written in PEP-7. It seems to me that PEP-7 doesn't require braces. But it explicitly forbids
if (cond) {
statement;
} else {
statement;
}
by saying "braces as shown", and then showing them like this:
if (mro != NULL) {
...
}
else {
...
}
That said, I agree with Benjamin: the shorter form is visually lighter and should not be frown upon.
Me too.
- Previous message: [Python-Dev] PEP 7 clarification request: braces
- Next message: [Python-Dev] PEP 7 clarification request: braces
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]