On Tue Nov 11 2014 at 3:09:38 PM Ben Finney <ben+pyt...@benfinney.id.au> wrote:
> "Clayton Kirkwood" <c...@godblessthe.us> writes: > > > So, there is a difference between None and False, is that the issue? > > Yes. Those two values are different and not equal; but both evaluate > false in a boolean context. > > Just to note; not all programming languages do it this way. Python is fairly permissive in what it allows to be "truthy". See: https://plus.google.com/+ShriramKrishnamurthi/posts/4qvvKYC1R8Y for a brief survey of what many other programming languages do. It can be confusing and bug-prone as heck. For myself, I usually want as restrictive an approach as possible with respect to what things are considered "truthy". If I'm in a boolean context, I will explicitly make the expression being tested be either True or False, and that's it. That way, I know I won't get into shaky waters. I program in multiple languages: I don't want to spend brain power remembering yet another a truth table about truth. To quote: "Let your statement be: 'Yes, yes', or "no, no': anything beyond these is of evil." :P
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor