PEP-308 a "simplicity-first" alternative

Peter Hansen peter at engcorp.com
Tue Feb 11 22:15:06 CET 2003


Paul Rubin wrote:
[on YATOP] 
> In fact it's not even obvious what it does.  
> What should the value of (2 and 0 else 3) be?

Hmm... (2 and 0) gives the value 0, so the result should clearly
be whatever (0 else 3) returns, which logically should be 3, right?

(In other words, I agree.  If you know it's a ternary op, you can
figure it out.  If you don't, it's entirely non-obvious what it's
doing, and reads to me more like a latent syntax error than anything
else.)

-Peter




More information about the Python-list mailing list