From 48d57b4bf8b9d6d9d0978ec6aded1df8ea01a8dd Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Wed, 24 Aug 2022 23:23:59 +0900 Subject: [PATCH] gh-96197: Define the behavior of repr if sys.displayhook is lost --- Doc/library/functions.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index da7de18722f87e..c12cfccf995a6b 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1513,6 +1513,8 @@ are always available. They are listed here in alphabetical order. of the type of the object together with additional information often including the name and address of the object. A class can control what this function returns for its instances by defining a :meth:`__repr__` method. + If :func:`sys.displayhook` is not accessible, this function will raise + :exc:`RuntimeError`. .. function:: reversed(seq)