4 ms·
{k: v for k, v in some_iterable} I'd never seen that. Nice. :)
by lhnz 14y ago
{k: v for k, v in some_iterable}
I'd never seen that. Nice. :)
- w0utert 14y agoDictionary comprehensions are pretty nice indeed, they're new in Python 2.7 so that might be why you've not seen them before ;-)