[Info] PEP 308 accepted - new conditional expressions
programmer.py at gmail.com
Sat Oct 1 01:05:15 CEST 2005
On 9/30/05, Sam <sam at email-scan.com> wrote:
> Reinhold Birkenfeld writes:
> > Hi,
> > after Guido's pronouncement yesterday, in one of the next versions of Python
> > there will be a conditional expression with the following syntax:
> > X if C else Y
> > which is the same as today's
> > (Y, X)[bool(C)]
> What's wrong with "C ? X:Y"?
> Aside from ":" being overloaded?
First thing that comes to my mind is that it is more C-ish (read
cryptic) than pythonic (read elegant and understandable).
More information about the Python-list