from dataclasses import dataclass @dataclass class Coordinates: x: int y: int def __add__(self, other: "Coordinates"): """ Return the result of the addition of two Coordinates objects. """ return Coordinates(x=self.x + other.x, y = self.y + other.y)