jmespath / jmespath/jmespath.py
Custom "None" value when search fails
Open
- Dominant language
- Python
- Stars
- 2.4k
- Forks
- 212
- PR merge metrics
- No merged PRs in 30d
Description
Hi, thanks for this awesome lib!
One question: it seems to be impossible to set a custom return in case the search fails.
E.g.
```
not_found = object()
jmespath.search('foo.aaa', {'foo': {'bar': 'baz'}}) # I need `not_found`, not `None`
```
Is this by design or are you open to supporting that?
I see this was discussed at https://github.com/jmespath/jmespath.py/issues/113
But the proposed solution of `contains` isn't great, as it requires 2 searches.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.