Russ P. wrote:

On Jul 29, 11:36 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote:
Russ P. wrote:
Come to think of it, shouldn't the list type have an "isempty" method?
Or does it?
Yes.  It's written:

        if not aList:
            ...

As you know, that is not quite exactly the same thing. An "isempty"
method would fail if aList were an integer, and such failure might be
desirable if someone mistakenly had aList pointing to an integer.

If you're that concerned about what the type is, then you can do explicit typechecks. Those are discouraged precisely because of Python's dynamism. But knock yourself out.

--
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 actor is not quite a human being -- but then, who is?
   -- George Sanders
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to