homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author michael.foord
Recipients ezio.melotti, jaap.karssenberg, michael.foord, r.david.murray
Date 2012年02月15日.23:29:03
SpamBayes Score 8.419443e-11
Marked as misclassified No
Message-id <1329348544.52.0.316662412612.issue14025@psf.upfronthosting.co.za>
In-reply-to
Content
assertEqual uses Python equality semantics - so if a str instance and a unicode instance compare equal then assertEqual passes. This is by design.
The type check in assertEqual, that delegates to the different comparison methods, is strict because we can't know that using the error message algorithms is sane for arbitrary subclasses - all we can know is whether an equality comparison fails or succeeds.
Using a diff algorithm for creating an error message only makes sense for text, which is why it is only done for unicode. For binary strings a diff is more likely to be unintelligible nonsense. 
For comparing unicode to strings you can call asssertMultilineEqual directly.
History
Date User Action Args
2012年02月15日 23:29:04michael.foordsetrecipients: + michael.foord, ezio.melotti, r.david.murray, jaap.karssenberg
2012年02月15日 23:29:04michael.foordsetmessageid: <1329348544.52.0.316662412612.issue14025@psf.upfronthosting.co.za>
2012年02月15日 23:29:04michael.foordlinkissue14025 messages
2012年02月15日 23:29:03michael.foordcreate

AltStyle によって変換されたページ (->オリジナル) /