For review: PEP 308 - If-then-else expression

Steven D. Arnold stevena at neosynapse.net
Fri Feb 7 17:41:38 EST 2003


On 2/7/03 3:22 PM, "Gerrit Holl" <gerrit at nl.linux.org> wrote:

> IMHO, since else is obliged, 'x if a' is not allowed but 'x if a else None'
> is, which is not intuitive.

I would agree here that "else" definitely should not be obligatory.  The
"else None" should be implied if the else is missing.  "Explicit is better
than implicit" is, I hope, a good rule of thumb rather than an absolute
principle that trumps even intuitiveness and readability.

Still, if I had to choose between the proposal as it stands or nothing at
all, I would take the proposal as it stands.

steve
-- 







More information about the Python-list mailing list