Hacker News new | ask | show | jobs
by kelnos 2905 days ago
For stuff like that I'd just use `defaultdict`. That if/else tree then reduces to 2 lines total.
1 comments

That’s a good tip, thanks!