Test/bin/Classess/Track.py

18 lines
429 B
Python
Raw Permalink Normal View History

2021-05-23 22:32:00 +02:00
class Track:
2021-05-24 16:43:07 +02:00
def __init__(self, priority, road):
self.priority = priority
2021-05-23 22:32:00 +02:00
self.road = road
2021-05-24 16:43:07 +02:00
def __eq__(self, other):
try:
return self.priority == other.priority
except AttributeError:
return NotImplemented
def __lt__(self, other):
try:
return self.priority < other.priority
except AttributeError:
return NotImplemented
2021-05-23 22:32:00 +02:00