On 2/21/2014 5:06 PM, Jan Kaliszewski wrote: > Or even (still being my favorite): > > msg = seq[i] except (IndexError: "nothing") This syntax actually has a benefit: the parenthesized syntax after except could become a list, to allow handling different exceptions from the tried expression with different results: msg = seq[dictionary[i]] except (IndexError: "nothing", KeyError: "serious problems") And still allows nesting: msg = seq[i] except (IndexError: dictionary[i] except (KeyError: "no fallback data for %s" % i)) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20140221/5c2f532b/attachment.html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4