How Best to Coerce Python Objects to Integers?

Ethan Furman ethan at
Tue Jan 3 18:09:52 EST 2017

On 01/03/2017 02:47 PM, Chris Angelico wrote:
> On Wed, Jan 4, 2017 at 9:42 AM, Ethan Furman wrote:

>> Aside from calling "except Exception" a "naked except"
> If you read the comments, you'll see that he originally had an actual
> bare except clause, but then improved the code somewhat in response to
> a recommendation that SystemExit etc not be caught.

I did read the comments and noticed the reasons for the improved code; fixing the article to not use the "naked except" phrase would be another improvement.

And, of course, whether or not "except Exception" is too broad depends on the use-case.


More information about the Python-list mailing list