Jaap Karssenberg <jaap.karssenb...@gmail.com> added the comment: On Fri, Feb 17, 2012 at 1:23 AM, Ezio Melotti <rep...@bugs.python.org>wrote:
> > Ezio Melotti <ezio.melo...@gmail.com> added the comment: > > If you really want the diff you could use assertMultiLineEqual, but even > on Python 2 you shouldn't mix str and unicode. I would rather fix the code > to return unicode than using assertMultilineEqual to get a diff between str > and unicode. Moreover assertMultiLineEqual only works if the str happens > to be ASCII-only: > Yes I'm aware of that. However to my mind there is an inconsistency between having assertEqual dispatch per type and having to use explicitly assertMultiLineEqual. If assertMultiLineEqual accepts basestring, I should be able to register it as such. More practically I have a large suite of code using assertEqual comparing mixed str and unicode. This code was written before the diff function was available (in fact I had a custom diff function in the subclass). As long as tests are OK this works fine, so I rather not touch them, but if they fail I don't get the output I need. Anyway, since I feel there is no consensus on this, I went ahead and patched assertEqual in my custom subclass and move ahead. I can submit a formal patch if there is a chance of it being accepted. Regards, Jaap ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14025> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com