[Python-ideas] except expression

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Feb 13 23:22:05 CET 2014


Chris Angelico wrote:
> phone = "Unknown" if except KeyError else addressbook[name]

-42. My brain gets totally derailed when it hits "if except";
it parses that bit as a syntax error.

-- 
Greg



More information about the Python-ideas mailing list