[issue38789] difflib lacks a way to check if results are empty

2019-11-18 Thread Simon Friedberger
Simon Friedberger added the comment: And, just to state this explicitly, I think you are right that there are general idioms for checking if a generator can produce an item but I think it would be nicer if iterators which could do this is in a cheap way (like in this case) would allow

[issue38789] difflib lacks a way to check if results are empty

2019-11-18 Thread Simon Friedberger
Simon Friedberger added the comment: Hi Tim! Sorry, if my explanation wasn't clear. For some of the iterators - like the one produced by ndiff - the iterator will always return data, even if there is no difference in the files. My current solution is to run difflib.unified_diff and check

[issue38789] difflib lacks a way to check if results are empty

2019-11-13 Thread Simon Friedberger
New submission from Simon Friedberger : It seems there is no easy way to use difflib to show a diff but only when there actually are differences. The SequenceMatcher has ratio() but that isn't really available through Differ or any of the convenience functions. Vice versa, when using

[issue38789] difflib lacks a way to check if results are empty

2019-11-13 Thread Simon Friedberger
Change by Simon Friedberger : -- type: -> enhancement ___ Python tracker <https://bugs.python.org/issue38789> ___ ___ Python-bugs-list mailing list Unsubscrib