Carl Banks wrote:

On Jul 30, 1:15 am, "Russ P." <[EMAIL PROTECTED]> wrote:
All this discussion about "if x" has me wondering. I use it all the
time because a fully explicit test just seems redundant. But maybe it
does have some value in terms of readability and type checking. After
all, it is possible to forget whether something is a number or a list.

IMO, the only time I think "if x" is really dangerous is if you are
using "if x" instead of "if x is None" to distinguish between None and
a type that can have false values.

Well, that would be an exceptionally bad way to test for None-ness, since None is false. The test would never succeed.

Having said that, it would sure be nice to be able to write

if myList is not empty:

instead of

if len(myList) != 0:

I can agree with this.

I'm getting this sneaking suspicion that you guys are all putting us on.

--
Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/
 San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis
  The doors of Heaven and Hell are adjacent and identical.
   -- Nikos Kazantzakis
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to