14 Feb
2014
14 Feb
'14
4:20 p.m.
Here's another one: things[i] (except IndexError: 42) This has the advantage of putting the colon inside parens, where it's less likely to get confused with other uses of colons in the same line (by humans, if not by the computer). Also it might be useful to be able to say things.remove(i) (except ValueError: pass) which would be equivalent to things.remove(i) (except ValueError: None) but would read more smoothly in cases where you're not interested in the value of the expression. -- Greg