checking if a list is empty

Ian hobson42 at gmail.com
Sun May 22 05:20:00 EDT 2011


On 12/05/2011 04:51, Chris Angelico wrote:
> On Thu, May 12, 2011 at 7:02 AM, Ian<hobson42 at gmail.com>  wrote:
>> In the "real world"  lists of zero items do not exist.
>> You don't go shopping with a shopping list of zero items.
> Actually, yes you do. You maintain your shopping list between trips;
> whenever you need something, you put it on the list immediately. Then
> when you go shopping, you just take the list with you (if you're
> lucky, you don't need to move or copy it at all, you just get another
> reference to it). Once you're done, you empty the list - you now have
> a shopping list with zero items (until you get home and realize you
> forgot something).
>
> Chris Angelico
He He.

I didn't claim an empty list was not useful!   If you maintain it 
between trips, then
yes, you arrive back with an empty list.

Ian






More information about the Python-list mailing list