h2non / jsonpath-ng

Finally, a JSONPath implementation for Python that aims to be standard compliant. That's all. Enjoy!
Apache License 2.0
572 stars 85 forks source link

always return sub value #83

Open Janim007 opened 3 years ago

Janim007 commented 3 years ago

python sub method always return the original value even if there was no match and replacement. to be consistent with python, this PR propose to remove checking if value hasn't changed and return the original value as it as. example:

>>> re.sub(r'foo', 'bar', 'github')
'github'
michaelmior commented 11 months ago

@Janim007 Is there a specific problem this causes in the existing code? Could you add a test for such a case?