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

Roy Smith roy at
Sun Feb 9 18:09:44 CET 2003

Alex Martelli <aleax at> wrote:
> I particularly like the generalization to an int on the LHS of the
> new proposed -> operator.

What happens in the integer version if the index is out of bounds for 
the list of code fragments?  Do you get some default, or do you raise 
IndexError?  Or maybe it just returns None?  I could see arguments in 
favor of any of these.

More information about the Python-list mailing list