Skip to content

Commit 1a8ce87

Browse files
authored
Merge pull request #3375 from aatle/geometry-repr
Remove angled brackets from Circle and Line reprs
2 parents e244c6c + 3e8b74f commit 1a8ce87

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src_c/circle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pg_circle_repr(pgCircleObject *self)
9191
return NULL;
9292
}
9393

94-
PyObject *result = PyUnicode_FromFormat("<Circle((%R, %R), %R)>", x, y, r);
94+
PyObject *result = PyUnicode_FromFormat("Circle((%R, %R), %R)", x, y, r);
9595

9696
Py_DECREF(x);
9797
Py_DECREF(y);

src_c/line.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,7 @@ pg_line_repr(pgLineObject *self)
261261
return NULL;
262262
}
263263

264-
result =
265-
PyUnicode_FromFormat("<Line((%R, %R), (%R, %R))>", ax, ay, bx, by);
264+
result = PyUnicode_FromFormat("Line((%R, %R), (%R, %R))", ax, ay, bx, by);
266265

267266
Py_DECREF(ax);
268267
Py_DECREF(ay);

test/geometry_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -619,14 +619,14 @@ def test_diameter_del(self):
619619

620620
def test__str__(self):
621621
"""Checks whether the __str__ method works correctly."""
622-
c_str = "<Circle((10.3, 3.2), 4.3)>"
622+
c_str = "Circle((10.3, 3.2), 4.3)"
623623
circle = Circle((10.3, 3.2), 4.3)
624624
self.assertEqual(str(circle), c_str)
625625
self.assertEqual(circle.__str__(), c_str)
626626

627627
def test__repr__(self):
628628
"""Checks whether the __repr__ method works correctly."""
629-
c_repr = "<Circle((10.3, 3.2), 4.3)>"
629+
c_repr = "Circle((10.3, 3.2), 4.3)"
630630
circle = Circle((10.3, 3.2), 4.3)
631631
self.assertEqual(repr(circle), c_repr)
632632
self.assertEqual(circle.__repr__(), c_repr)
@@ -2203,14 +2203,14 @@ def test_meth_update(self):
22032203

22042204
def test__str__(self):
22052205
"""Checks whether the __str__ method works correctly."""
2206-
l_str = "<Line((10.1, 10.2), (4.3, 56.4))>"
2206+
l_str = "Line((10.1, 10.2), (4.3, 56.4))"
22072207
line = Line(10.1, 10.2, 4.3, 56.4)
22082208
self.assertEqual(str(line), l_str)
22092209
self.assertEqual(line.__str__(), l_str)
22102210

22112211
def test__repr__(self):
22122212
"""Checks whether the __repr__ method works correctly."""
2213-
l_repr = "<Line((10.1, 10.2), (4.3, 56.4))>"
2213+
l_repr = "Line((10.1, 10.2), (4.3, 56.4))"
22142214
line = Line(10.1, 10.2, 4.3, 56.4)
22152215
self.assertEqual(repr(line), l_repr)
22162216
self.assertEqual(line.__repr__(), l_repr)

0 commit comments

Comments
 (0)