A better way for "except" and "return"?

Lewis Bergman lbergman at abi.tconline.net
Fri Jan 4 15:23:20 EST 2002


Thanks for all the suggestions.
I made all the changes and cut out about 60 lines of code. What a difference!
Actually, what is funny is that I started without all the try, except stuff. 
But, after reading the DB API I added it in. It looks a lot better and I feel 
better knowing that the errors are raised anyway. Also, the "is" and "is not" 
tip makes it so much more readable.

I decided to go ahead and return a 0 since it is over a network. Just the one 
change to check data and return an error right then makes the code so much 
more readable. Thanks for the time you took to answer. You have been a _big_ 
help!
-- 
Lewis Bergman
Texas Communications
4309 Maple St.
Abilene, TX 79602-8044
915-695-6962 ext 115




More information about the Python-list mailing list