On Sat, 22 Feb 2014 02:12:04 +1100 Chris Angelico <rosuav at gmail.com> wrote: > > Overbroad exception handling comes in two ways. One is simply catching > Exception or BaseException when a narrower class would be better, and > that's not addressed by this PEP (except insofar as it does not have a > bare "except:" syntax, and so it forces you to at least be explicit > about catching BaseException). The other is this: > > try: > f(x[i]) > except IndexError: > f(default) > > Translating that into this form: > > f(x[i] except IndexError: default) > > means that an IndexError thrown inside f() will not be caught. Thank you and Nick for the explanation. This is a good point. I'm still put off by the syntax, though, just like Brett. Regards Antoine.
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