Ben Finney <ben+pyt...@benfinney.id.au> writes:

> This is short and clear and needs no leaking of the underlying bool
> implementation::
>
>     len(True for line in lines if line.strip())

Correction::

    len([True for line in lines if line.strip()])

-- 
 \     “Our task must be to free ourselves from our prison by widening |
  `\    our circle of compassion to embrace all humanity and the whole |
_o__)                       of nature in its beauty.” —Albert Einstein |
Ben Finney

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

Reply via email to