-
Notifications
You must be signed in to change notification settings - Fork 151
Open
Description
is it possible to extend Matchers
def selecter(fn:callable(), _):
""" Matcher that matches f (value) = True """
return fn(_)
then
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")
the it only go down if a predicate was eval to True ?
Metadata
Metadata
Assignees
Labels
No labels