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

Erik Max Francis max at
Thu Feb 13 00:55:03 CET 2003

David Eppstein wrote:

> In article <mailman.1045024432.16082.python-list at>,
>  Andrew McNamara <andrewm at> wrote:
> >         c -> { 0: x, 1: y, 2: z }
> Interesting syntax.  My biggest concern with it is that the right hand
> side looks just like a normal dictionary -- to do ternary operators
> correctly you'd want some kind of lazy evaluation there, but the
> laziness isn't apparent from the syntax.

I agree.  If you're really going to shoot for _some_ kind of lazy
evaluation syntax, I think something that does not look like anything
we've seen would be better.  I'd much prefer something like <>
delimiters, although I have no idea if that would cause grammar
problems.  i.e., if you're really going to implement lazy evaluation, it
should look like nothing you've seen before, so there's no question This
Is Something New.

 Erik Max Francis / max at /
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ You cannot step into the same river once.
\__/ Cratylus
    Python chess module /
 A chess game adjudicator in Python.

More information about the Python-list mailing list