David Mertz, Ph.D. writes:
> I think the Python version does the right thing by emphasizing the
> DEFAULT by putting it first, and leaving the predicate and fallback
> until later in the expression (right for Pythonic code, not right
> for other languages necessarily).
Aside: I think that's true for Pythonic scripting, but in general I
think you're just as likely to find that it's a genuine choice, and
that the condition is as interesting as either choice.
Variation on the theme of conditional expression: I'd often like to
write
var = computed() if cond() else break
or
var = computed() if cond() else continue
I wonder if that syntax has legs, or if it's too cute to stand.
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/WUSUIRQ5XLFSS5JQKI3DYZ7SIDABERKY/
Code of Conduct: http://python.org/psf/codeofconduct/