35 lines
861 B
Python
35 lines
861 B
Python
|
|
class Person:
|
|
def __init__(
|
|
self,
|
|
firstName: str,
|
|
lastName: str,
|
|
club: str,
|
|
group: str
|
|
):
|
|
self.firstName = firstName
|
|
self.lastName = lastName
|
|
self.club = club
|
|
self.group = group
|
|
|
|
def __eq__(self, o):
|
|
if not isinstance(o, Person):
|
|
False
|
|
|
|
return (
|
|
self.firstName == o.firstName and
|
|
self.lastName == o.lastName and
|
|
self.club == o.club and
|
|
self.group == o.group
|
|
)
|
|
|
|
def getTuple(self):
|
|
return (self.firstName, self.lastName, self.club)
|
|
|
|
def __repr__(self):
|
|
return f'{self.firstName} {self.lastName} ({self.club}, {self.group})'
|
|
|
|
def __hash__(self):
|
|
return self.firstName.__hash__() + self.lastName.__hash__() + self.club.__hash__()
|
|
|