M.-A. Lemburg wrote: > If a string > is not ASCII and thus causes the exception, there's not a lot you > can say, since you don't know the encoding of the string.
That's one way of looking at it. Another is that any string containing chars > 127 is not text at all, but binary data, in which case it's not equal to *any* unicode string -- just like bytes objects will not be equal to strings in Py3k. > All you > know is that it's not ASCII. Instead of guessing, Python then raises > an exception to let the programmer decide. There's no disputing that an exception should be raised if the string *must* be interpretable as characters in order to continue. But that's not true here if you allow for the interpretation that they're simply objects of different (duck) type and therefore unequal. -- Greg _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com