Implicit conversion to boolean in if and while statements

Ranting Rick rantingrickjohnson at gmail.com
Sun Jul 15 23:21:41 EDT 2012


On Jul 15, 9:58 pm, Steven D'Aprano <steve
+comp.lang.pyt... at pearwood.info> wrote:
> On Sun, 15 Jul 2012 18:21:06 -0700, Ranting Rick wrote:
> > If HOWEVER we want to "truth test" an object (as in: "if obj") we should
> > be FORCED to use the bool! Why? Because explicit is better than implicit
>
> And this is why Rick always writes code like:
...

Traceback (most recent quip last):
  Author: "<DeAprano>", line 7, in <post>
LogicalFallacyError: "Reductio ad absurdum"




More information about the Python-list mailing list