Ilya Kamenshchikov <ikamenshchi...@gmail.com> added the comment: Changing behavior and it's impact on existing code is, without a doubt, a big deal here. Maybe it's a reason not to do anything about it.
Just to understand guiding design principle, what is expected from __str__ in more general case? I thought about it as "user-friendly string representation", therefore expected an Exception without a message to identify itself by it's class. Best Regards, -- Ilya Kamen On Thu, Aug 6, 2020 at 6:05 PM Rémi Lapeyre <rep...@bugs.python.org> wrote: > > Rémi Lapeyre <remi.lape...@henki.fr> added the comment: > > > That's a solution, except you must know ahead of time this issue exists. > > If we changed str(e) to make it the same as repr(e), there would be no way > to get only the message. str(e) returns the message so if the message given > was empty (or no message was given) you get an empty string. This cannot be > changed without breaking a lot of code. > > ---------- > versions: +Python 3.10, Python 3.9 > > _______________________________________ > Python tracker <rep...@bugs.python.org> > <https://bugs.python.org/issue41478> > _______________________________________ > ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41478> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com