On Tue, Apr 19, 2016, at 11:09 PM, Ethan Furman wrote: > On 04/19/2016 10:51 PM, Stephen Hansen wrote: > > I use 1) more to be less 'nicer' and more, er, 'more specific'. Since I > > don't like exceptions to rise to the user level where niceness is > > needed. > > Yeah, that's a better phrasing for (1); I meant more appropriate or > informative, such as swapping an internal error (such as KeyError) for a > more meaningful FieldNotFound error (or whatever) -- largely library > code concerns.
Yeah, and what the OP is doing is going the exact opposite-- from a more-specific exception (KeyError) to a more generic one (Exception). To me that's (usually) an anti-pattern. --S -- https://mail.python.org/mailman/listinfo/python-list