3 ms·
I would argue the functional approach is (copying your data structures): def winning_team(game_log: GameLog) -> Team: return max( get_t
by jasonjmcghee 2y ago
I would argue the functional approach is (copying your data structures):
def winning_team(game_log: GameLog) -> Team:
return max(
get_teams(game_log),
key=lambda t: get_points(game_log, t)
)
- whalesalad 2y agoI think this is a very unproductive and pedantic take of functional programming. Inside the function, all things being equal, the implementation isn’t important. The important thing is that it’s isolated, self contained and does not perform I/O