> I know this is a simplified example, but I'd still like to point out that > using exceptions when there's a simple test is not reasonable. You can > just check for None with a simple if test.
An "if" test would be more readable, I agree. But I was trying to apply the "Easier to Ask Permission Forgiveness" style, discussed in the Python Cookbook: , http://tinyurl.com/lfp35q And in this recipe from the book: http://code.activestate.com/recipes/52291/ The example Martelli uses is far more complicated than my simple use case of checking for None, so perhaps I've engaged in a bit of overkill? Or perhaps I'm not fully understanding the lesson. I'll admit, the latter is very possible since I'm still on the front end of the learning curve... _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor