def has_links(posts: List[Post], *patterns, **kwargs) -> Iterable[Post]:
'''
Returns all posts which have matching links in them.
Args:
post (List[Post]): Posts to filter
*patterns (List[str]): Patterns which links should match
not (List[str]) : Patterns which links should not match. E.g., not=['google', 'longecity', 'amazon']
'''
return filter(lambda p: (len(match_links(p, *patterns, **kwargs)) > 0), posts)
评论列表
文章目录