Boolean tests [was Re: Attack a sacred Python Cow]

Russ P. Russ.Paielli at gmail.com
Wed Jul 30 02:47:21 EDT 2008


On Jul 29, 11:36 pm, Erik Max Francis <m... at alcyone.com> 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.



More information about the Python-list mailing list