def none_aware(val, default): return default if val is None else val The library has a function that returns either a list or None, but I want to write
return [HtmlParser(el) for el in none_aware(content.select('...'), [])] Instead of several lines of checks.