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 andrei.avk
Recipients andrei.avk, iritkatriel, jbw, kj, moi90, serhiy.storchaka
Date 2021-10-20.13:46:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1634737585.68.0.635685952631.issue43656@roundup.psfhosted.org>
In-reply-to
Content
Joe: when I ran your code sample with modification I posted previously, I don't get any errors. Can you try running it?

By the way my point was not that builtin __repr__ should be modified to never raise exceptions (which would not help in this case), but rather that users should try to write classes that can be safely repr()'ed with the __repr__ they have defined on the class.

I agree that this case is hard for new users to debug, but it indicates to the user that if a class and its __repr__ are implemented in this way, it can lead to more serious issue in production.

Possibly this can be improved by making a documentation update to https://docs.python.org/3/reference/datamodel.html?highlight=__repr__#object.__repr__  ?
History
Date User Action Args
2021-10-20 13:46:25andrei.avksetrecipients: + andrei.avk, serhiy.storchaka, iritkatriel, moi90, kj, jbw
2021-10-20 13:46:25andrei.avksetmessageid: <1634737585.68.0.635685952631.issue43656@roundup.psfhosted.org>
2021-10-20 13:46:25andrei.avklinkissue43656 messages
2021-10-20 13:46:25andrei.avkcreate