[FR] Add replaceShallow function to matchers
Open
machinery
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 229
- PR merge metrics
- No merged PRs in 30d
Description
The `matchers` module have functions that operate either just on the given node (`extract`), or in the node and its children (`findall`, `extractall`). However for `replace` there's no such distinction.
One could mimic that behavior by first calling `m.matches(node, matcher)`, but that would be much less performant.
Ideally these two functions would be named `replace` and `replaceall`, to be consistent with the rest of the api, but I do not know what policies you have in place with regards to backwards compatibility.
Contributor guide
Assessment
This issue has not been assessed yet.