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

2019-11-18 Thread Tim Peters
Tim Peters added the comment: I'm taking Raymond's advice to close this for now. The issue tracker isn't the right place to work out ideas - python-ideas is far better for that (StackOverflow isn't a good place for that either - StackOverflow is best for when you have a very specific use

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

2019-11-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: Simon, I think the conversation is starting to drift and would best be continued on python-ideas or StackOverflow. Ideas like peekable generators have been discussed before but there was almost no uptake. Several thoughts: * For equal inputs, ndiff()

[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 it

[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-14 Thread Tim Peters
Tim Peters added the comment: Please be explicit: exactly which functions are you talking about, and exactly what do you want them to do instead. Since, best I can tell, this is the first complaint of its kind, it's a pretty safe bet people can't guess what you want ;-) Note that, e.g.,

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

2019-11-13 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> tim.peters nosy: +tim.peters versions: +Python 3.9 -Python 3.7 ___ Python tracker ___

[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 ___ ___ Python-bugs-list mailing list Unsubscribe: