From: Peter Sutton Date: Wed, 1 Apr 2026 16:16:36 +0000 (+0100) Subject: Docs: Use !r in __repr__ example (gh-146273) X-Git-Tag: v3.15.0a8~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=021ee7fd6a09971fbef5cf0e194b8087ae88677d;p=thirdparty%2FPython%2Fcpython.git Docs: Use !r in __repr__ example (gh-146273) --- diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 483e5b1d8fdb..e8c4605d0578 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1754,7 +1754,7 @@ are always available. They are listed here in alphabetical order. self.age = age def __repr__(self): - return f"Person('{self.name}', {self.age})" + return f"Person({self.name!r}, {self.age!r})" .. function:: reversed(object, /)