[issue7032] Make assertMultilineEqual default for unicode string comparison in
Antoine Pitrou
report at bugs.python.org
Fri Oct 2 12:41:30 CEST 2009
Antoine Pitrou <pitrou at free.fr> added the comment:
> Because diffing binary data isn't useful...
But often it's non-binary data ;)
> This is the reason that assertMultilineEqual isn't already the default
> for comparing strings - because in Python 2 when you have strings you
> don't know if the intention is for them to contain textual information
> or binary information.
You could have a heuristic which counts the number of "\n" bytes and, if
there are more than 1/80th of them, you're likely to have some text.
(80 being the typical max line length)
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7032>
_______________________________________
More information about the Python-bugs-list
mailing list