On Thu, 2009-10-08 at 12:58 -0700, wesley chun wrote: > wow, as the OP, you must have been surprised to see how far we have > taken your (seemingly) simple question.
Pleasently suprised :-) And I am gratefull to see the heavy weights join in. > however, what i did *not* mention is that these (abbreviated) > comparisons do not work should you care to distinguish between > multiple Python objects/values that have the same boolean value. in > other words, "if not b" will catch False, None, 0, etc. if your > application is using 3 values like None (for unset value), False > (bad/errror code), and True (correct behavior), then None and False > will both cause the if clause to be executed. in other words, if you > care about the actual objects, then you need to use either "==" or > "is", rather than just checking their boolean outcomes. Good one, I have to remember this as it will very likely bite me someday. I really appriciate all the feedback and good advice! Thanks Sander _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor