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 Ilya Kamenshchikov
Recipients Ilya Kamenshchikov, remi.lapeyre
Date 2020-08-06.18:26:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAAp-DqJp5EbJrr40CiUU=_zBQ6A_xPH88RiN=vJy8xLj47uY2Q@mail.gmail.com>
In-reply-to <1596729707.47.0.48935010012.issue41478@roundup.psfhosted.org>
Content
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>
> _______________________________________
>
History
Date User Action Args
2020-08-06 18:26:24Ilya Kamenshchikovsetrecipients: + Ilya Kamenshchikov, remi.lapeyre
2020-08-06 18:26:24Ilya Kamenshchikovlinkissue41478 messages
2020-08-06 18:26:24Ilya Kamenshchikovcreate