<br><br><div class="gmail_quote">On Tue Nov 11 2014 at 3:09:38 PM Ben Finney <<a href="mailto:ben%2Bpython@benfinney.id.au">ben+python@benfinney.id.au</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">"Clayton Kirkwood" <<a href="mailto:crk@godblessthe.us" target="_blank">crk@godblessthe.us</a>> writes:<br>
<br>
> So, there is a difference between None and False, is that the issue?<br>
<br>
Yes. Those two values are different and not equal; but both evaluate<br>
false in a boolean context.<br><br></blockquote><div><br></div><div><br></div><div>Just to note; not all programming languages do it this way.  Python is fairly permissive in what it allows to be "truthy".  See: <a href="https://plus.google.com/+ShriramKrishnamurthi/posts/4qvvKYC1R8Y">https://plus.google.com/+ShriramKrishnamurthi/posts/4qvvKYC1R8Y</a> for a brief survey of what many other programming languages do.</div><div><br></div><div>It can be confusing and bug-prone as heck.</div><div><br></div><div>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.</div><div><br></div><div>To quote: "Let your statement be: 'Yes, yes', or "no, no': anything beyond these is of evil."</div><div><br></div><div>:P</div></div>