4 ms·
# `None` means `lambda x: x` here I find it more helpful to think of it as meaning `bool` in that context. I think the None special case is only there because
by euccastro 18y ago
# `None` means `lambda x: x` here
I find it more helpful to think of it as meaning `bool` in that context. I think the None special case is only there because filter() predates bool() in Python.
- d0mine 18y agoThanks. `bool` is more readable. "\n".join(filter(bool, descriptions)) Or `len` "\n".join(filter(len, descriptions))