while true: !!!

Remco Gerlich scarblac at pino.selwerd.nl
Thu Dec 21 11:12:49 EST 2000


Steve Holden <sholden at holdenweb.com> wrote in comp.lang.python:
> Greg Ewing <greg at cosc.canterbury.ac.nz> wrote in message
> news:3A41539E.DF6977D6 at cosc.canterbury.ac.nz...
> > gbreed at cix.compulink.co.uk wrote:
> > >
> > > Take any type, and if
> > > there's a way of it being nothing, it evaluates false.
> >
> > Hmmm, let's try that out. Is [[]] true or false?
> > It's a list containing a list containing nothing.
> > Since [] is false, a list containing nothing must be
> > nothing. So [[]] is a list containing nothing,
> > which is nothing. Ah, it must be false! :-)
> >
> > Nothing-is-weird-stuff,
> >
> if [[]]:
>     print "Ewing is wrong"
> else:
>     print "Ewing is right"
> 
> Ewing is wrong

I'm sure he is perfectly aware of that, and used it to show that 
Graham (gbreed)'s method of checking if something is false doesn't
work.

-- 
Remco Gerlich



More information about the Python-list mailing list