[Python-ideas] except expression

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Feb 18 07:19:25 CET 2014


Chris Angelico wrote:

> func(menu.remove(mint) except ValueError: pass)

That would be a syntax error, because the except
expression is *not* in a value-ignoring context
here.

You would have to say

    func(menu.remove(mint) except ValueError: None)

-- 
Greg


More information about the Python-ideas mailing list