blob: a5cee80fa9da7e988041b0c184844e3b06cc36dc (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
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)
|