dwelch91 wrote:
> tac-tics wrote:
> >
> > I'd say the second one. Empty lists are not false. They are empty. Long
> > live dedicated boolean data types.
> >
> Uh, no, empty lists are False in a boolean context:
>
> http://docs.python.org/lib/truth.html
>
> -Don

Perhaps I should have specified it like this:

>>> empty_list = []
>>> empty_list is not False
True

I'm well aware that both of these snippets does the same thing. I'm
just spouting my opinion that lists and integers are not tests, and in
an ideal world (Java??? X-) if statements support only boolean types.

DISCLAIMER: I do not promote the use of Java.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to