3 ms·
For stuff like that I'd just use `defaultdict`. That if/else tree then reduces to 2 lines total.
by kelnos 8y ago
For stuff like that I'd just use `defaultdict`. That if/else tree then reduces to 2 lines total.
- stfwn 8y agoThat’s a good tip, thanks!