For review: PEP 308 - If-then-else expression
Jack Diederich
jack at performancedrivers.com
Fri Feb 7 13:17:52 EST 2003
On Fri, Feb 07, 2003 at 06:46:55PM +0100, holger krekel wrote:
> What about a missing else clause? e.g.
>
> <expression> if <condition>
if (<condition>): <expression>
is already legal so I'm -1 for yet another way to do it
> Allowing it could be nice for stuff like
> result = obj(...) if callable(obj)
-1 as above
> Note though, that this proposal obfuscates control "flow"
> (which guido already knows, of course). You can't read it
> neither from "left to right" nor from "right to left".
a good reason for -1, another would be that perl has both
ways of doing it ;)
if-theres-only-one-way-to-do-it-I-can-read-your-code-ly
-jackdied
More information about the Python-list
mailing list