Skip to content

Commit 021ee7f

Browse files
Docs: Use !r in __repr__ example (pythongh-146273)
1 parent 255026d commit 021ee7f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Doc/library/functions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,7 @@ are always available. They are listed here in alphabetical order.
17541754
self.age = age
17551755

17561756
def __repr__(self):
1757-
return f"Person('{self.name}', {self.age})"
1757+
return f"Person({self.name!r}, {self.age!r})"
17581758

17591759

17601760
.. function:: reversed(object, /)

0 commit comments

Comments
 (0)