'Using is not None, may not always work'

Michael Hudson mwh at python.net
Fri Aug 6 10:16:25 EDT 2004


Heiko Wundram <heikowu at ceosg.de> writes:

> Am Freitag, 6. August 2004 15:15 schrieb Doug Fort:
> > Since I installed 2.4a2 I've been getting a warning from pychecker: Using
> > is not None, may not always work'. I thought 'is not None' was the right
> > thing to do. I've had problems with 'if not x:', because some objects
> > return False in this context.
> 
> That's probably what pychecker warns you about: that you might get an object 
> in the respective context which evaluates to boolean false, but is not 
> None... Although I'd find this strange...

Does seem an odd warning, seeing as when I write "x is not None" I'm
generally avoiding the case of, e.g., x being the empty list.

Cheers,
mwh

-- 
  Well, you pretty much need Microsoft stuff to get misbehaviours
  bad enough to actually tear the time-space continuum.  Luckily 
  for you, MS Internet Explorer is available for Solaris.
                              -- Calle Dybedahl, alt.sysadmin.recovery



More information about the Python-list mailing list