and [True,True] --> [True, True]?????
"Martin v. Löwis"
martin at v.loewis.de
Mon Apr 20 16:27:34 EDT 2009
>> I prefer to write it explicitly:
>>
>> if len(lst) > 0:
>> ...
>
> At the very least, IMO you should write this as
>
> if len(lst):
> ...
>
> There's no reason to be explicit about the numeric comparison.
I think in the mind-set that dislikes relying on boolean conversion
of lists, relying on boolean conversion of numbers is just as evil.
In this mindset (IIUC), you *have* to have an expression that is
either True or False in a boolean test (if and while).
Regards,
Martin
More information about the Python-list
mailing list