We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
__repr__
1 parent f745586 commit 5770006Copy full SHA for 5770006
Doc/library/functions.rst
@@ -1569,6 +1569,16 @@ are always available. They are listed here in alphabetical order.
1569
If :func:`sys.displayhook` is not accessible, this function will raise
1570
:exc:`RuntimeError`.
1571
1572
+ This class has a custom representation that can be evaluated::
1573
+
1574
+ class Person:
1575
+ def __init__(self, name, age):
1576
+ self.name = name
1577
+ self.age = age
1578
1579
+ def __repr__(self):
1580
+ return f"Person('{self.name}', {self.age})"
1581
1582
1583
.. function:: reversed(seq)
1584
0 commit comments