How Best to Coerce Python Objects to Integers?

Ethan Furman ethan at stoneleaf.us
Mon Jan 2 21:42:52 EST 2017


On 01/03/2017 01:41 PM, breamoreboy at gmail.com wrote:
> Hi all, I'd suggest that this [1] is not one of the greatest articles
> ever written about Python exception handling. Other opinions are welcome.

Aside from calling "except Exception" a "naked except" I think it's decent. He 
walks through the problem, explains the rationale, and only has one line of 
code guarded by the except clause.
--
~Ethan~
[1] http://blog.pyspoken.com/2017/01/02/how-best-to-coerce-python-objects-to-in 
tegers/


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /