def selecter(fn:callable(), _):
""" Matcher that matches f (value) = True """
return fn(_)
news_paper = freeze({'articles': [{'author': 'Sara', 'content': 'A short article'},
{'author': 'Steve', 'content': 'A slightly longer article'}],
'weather': {'temperature': '11C', 'wind': '5m/s'}})
very_short_news = news_paper.transform(['articles'
, lambda n:len(n['content'])>15
, 'content'], lambda _: "longer story")
# Matchers
is it possible to extend
Matchersthen
the it only go down if a predicate was eval to True ?