I feel like this is sacrificing readability for brevity. I'd much rather see the dict split out. It could even be outside of the function since it doesn't need to be recreated on every call (though that's just a micro-optimization you don't really need to worry about unless you want to).