ensure attractiveness is always an int #25
| @@ -11,6 +11,6 @@ def take_most_important(landmarks: list[Landmark], n_important) -> list[Landmark | |||||||
|     """ |     """ | ||||||
|  |  | ||||||
|     # Sort landmarks by attractiveness (descending) |     # Sort landmarks by attractiveness (descending) | ||||||
|     landmarks.sort(key=lambda x: x.attractiveness, reverse=True) |     sorted_landmarks = sorted(landmarks, key=lambda x: x.attractiveness, reverse=True) | ||||||
|  |  | ||||||
|     return landmarks[:n_important] |     return sorted_landmarks[:n_important] | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user