Pythonic way to determine if a string is a number

python at bdurham.com python at bdurham.com
Tue Feb 17 16:45:48 CET 2009


Original poster here: Just for the record, my *original* post did
include an explicit trapping of the ValueError exception. :) 

My point is that the coaching offered by this forum does not always fall
on deaf ears.

Thanks for everyone's help on this and all the other posts in this
forum.

Regards,
Malcolm

In article <01aaa1da$0$20629$c3e8da3 at news.astraweb.com>,
 Steven D'Aprano <steve at pearwood.info> wrote:

> Okay, but that surely falls under chapter 18 of the "Advanced Python
> Programming for the Mars Rover" book rather than chapter 5 of "Newbies
> Guide to Python".

Well, sure, but this thread started out with my taking, ahem, exception
to the statement, "never use bare excepts at all". I agree that doing so
is not typical, and not the kind of habit that new programmers should
form 
because it's not the kind of situation new programmers are likely to be 
involved in.  But, "never" was too strong a word.



More information about the Python-list mailing list