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
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
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
Change by Simon Friedberger :
--
type: -> enhancement
___
Python tracker
<https://bugs.python.org/issue38789>
___
___
Python-bugs-list mailing list
Unsubscrib