harrismh777 wrote:
Lists by themselves, empty or not, cannot have a 'truth' in an of
themselves.
... forgot.,
Based on Ian's comment a couple of days ago...
if alist:
... is actually :
if bool(alist):
I think this is more than just semantics or silly argumentation. Its
important to understand where the boolean truth is coming from... my
understanding 'now' is that the list[] has no such boolean attribute,
but is cast for the 'if' construct....
so... if alist: is --> if bool(alist):
and... if not alist: is also --> if not bool(alist):
The 'alist[]' has no boolean attribute, right??
kind regards,
m harris
--
http://mail.python.org/mailman/listinfo/python-list