Add __repr__ to Race class
This commit is contained in:
@ -36,6 +36,9 @@ class Race:
|
|||||||
def __hash__(self) -> int:
|
def __hash__(self) -> int:
|
||||||
return hash(self.id)
|
return hash(self.id)
|
||||||
|
|
||||||
|
def __repr__(self) -> str:
|
||||||
|
return f"race(\n\tid={self.id}, name={self.name}, number={self.number},\n\tdate={self.date}, quali_date={self.quali_date},\n\thas_sprint={self.has_sprint}, place_to_guess={self.place_to_guess}\n)"
|
||||||
|
|
||||||
id: int
|
id: int
|
||||||
name: str
|
name: str
|
||||||
number: int
|
number: int
|
||||||
@ -46,4 +49,4 @@ class Race:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def name_sanitized(self) -> str:
|
def name_sanitized(self) -> str:
|
||||||
return quote(self.name)
|
return quote(self.name)
|
||||||
|
Reference in New Issue
Block a user