while true: !!!
Wed Dec 20 03:36:49 CET 2000
"Steve Holden" <sholden at holdenweb.com> wrote in message
news:ckJ%5.3097$Yv6.81688 at e420r-atl1.usenetserver.com...
> I've always tried to discourage students from comparing a Boolean with a
> constant, but it can be difficult to get the point over that (a) can
> evaluate as true even though (a == some_constant) may well evaluate to
> Clearly, if what you have is a Boolean value (i.e. one which can be used
> the expression in an "if" statement) then it's adding inefficiency to
> compare it with something, when what should be used is either
> if a:
> if not a:
> This works quite nicely in Python:
> >>> not "forever"
I had never thought of this before, but it is kind of interesting that
not 'this is a true string'
but instead produces 0.
Similarly, not [0, 1, 2] could produce  .
In fact, I could see where that might be useful. On the other hand (to be
consistent), what would
Also, shouldn't false == false ?
'' == 
Well, at least
(not '') == (not )
More information about the Python-list