def restrict_tags(tags, included, relation=operator.is_):
"""Restrict to tags that are related to at least one of the included set."""
return [t for t in make_bs4_iterable(tags) if any(relation(t, s) for s in make_bs4_iterable(included))]
# finding tags by chaining
评论列表
文章目录