Message374957
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 <report@bugs.python.org> wrote:
>
> Rémi Lapeyre <remi.lapeyre@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 <report@bugs.python.org>
> <https://bugs.python.org/issue41478>
> _______________________________________
> |
|
Date |
User |
Action |
Args |
2020-08-06 18:26:24 | Ilya Kamenshchikov | set | recipients:
+ Ilya Kamenshchikov, remi.lapeyre |
2020-08-06 18:26:24 | Ilya Kamenshchikov | link | issue41478 messages |
2020-08-06 18:26:24 | Ilya Kamenshchikov | create | |
|