<p>The problem is not using boolean evaluation - it's assuming that boolean evaluation is defined as "x is not None". Doing so introduces a completely unnecessary dependency on the type of "x". I'm frankly astonished that so many people seem to think it's a reasonable thing to do. </p>

<p>--<br>
Sent from my phone, thus the relative brevity :) </p>
<div class="gmail_quote">On May 8, 2012 8:01 PM, "Antoine Pitrou" <<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Tue, 8 May 2012 17:02:04 +1000<br>
Nick Coghlan <<a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>> wrote:<br>
><br>
> IMO, you've completely misdiagnosed the source of that bug. Never<br>
> *ever* rely on boolean evaluation when testing against None.<br>
<br>
Nick, that's just plain silly. If we didn't want people to rely on<br>
boolean evaluation, we wouldn't define __bool__ at all (or we would<br>
make it return a random value).<br>
<br>
Regards<br>
<br>
Antoine.<br>
<br>
<br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
</blockquote></div>