On Wed, 16 Mar 2016 11:41 pm, André Roberge wrote:

> for x in my_iterable:
>    # do something
> 
> if not my_iterable:
>    # do something else


Doesn't work for iterators. Iterators are (in general) always truthy,
whether they are empty or not.



-- 
Steven

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

Reply via email to