Skip to content

Commit b574e7f

Browse files
author
Henry
committed
🎨 add repr to class
1 parent ef6a336 commit b574e7f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

docs/tutorial/tutorial.ipynb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@
4444
"round(c2.radius, 3)"
4545
]
4646
},
47+
{
48+
"cell_type": "code",
49+
"execution_count": null,
50+
"metadata": {},
51+
"outputs": [],
52+
"source": [
53+
"c2 # repr"
54+
]
55+
},
4756
{
4857
"cell_type": "markdown",
4958
"metadata": {},

src/mockup/mockup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,6 @@ def diameter(self):
9292
@classmethod
9393
def from_circumference(cls, circumference: Union[int, float]) -> Self:
9494
return cls(circumference / (2 * cls.PI))
95+
96+
def __repr__(self):
97+
return f"Circle({self.radius})"

0 commit comments

Comments
 (0)