Comparison of two Point2D instances doesn't work as expected. Even if x and y attributes are same, return value of __eq__ is False:
def test_point2d_eq(self):
p1 = Point2D(1, 2)
p2 = Point2D(1, 2)
self.assertEqual(p1, p2)
AssertionError: Point2D(1, 2)(2.23606797749979, 1.1071487177940904) != Point2D(1, 2)(2.23606797749979, 1.1071487177940904)
Comparison of two
Point2Dinstances doesn't work as expected. Even ifxandyattributes are same, return value of__eq__isFalse: