On 22/02/2014 02:08, Glenn Linderman wrote: > 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") It shouldn't be a true list. We need lazy evaluation of the default values. And if an unlisted exception is raised, we don't want any of the defaults evaluated. Rob Cliffe > > And still allows nesting: > > msg = seq[i] except (IndexError: dictionary[i] except (KeyError: "no > fallback data for %s" % i)) > > > _______________________________________________ > Python-Dev mailing list > Python-Dev at python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/rob.cliffe%40btinternet.com > > > No virus found in this message. > Checked by AVG - www.avg.com <http://www.avg.com> > Version: 2012.0.2247 / Virus Database: 3705/6616 - Release Date: 02/22/14 > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20140224/1c6b8ea4/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