Nick Coghlan <ncogh...@gmail.com> added the comment: I agree the 2.6 implementation creates backwards compatibility problems with subclasses that only override __str__ that we didn't recognise at the time.
An alternative approach that should work even for the KeyError case is for BaseException_unicode to check explicitly for the situation where the __str__ slot has been overridden but __unicode__ is still the BaseException version and invoke "PyObject_Unicode(PyObject_Str(self))" when it detects that situation. That way subclasses that only override __str__ would continue to see the old behaviour, while subclasses that don't override either would continue to benefit from the new behaviour. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6108> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com