3 ms·
The biggest thing this gives, IMO, is the ability to filter on a computed value in a comprehension, and then use that computed value as the result. It's somethi
by int_19h 8y ago
The biggest thing this gives, IMO, is the ability to filter on a computed value in a comprehension, and then use that computed value as the result. It's something that's needed quite often if you use comprehensions heavily, and there's no good workaround for it currently (you can use a nested "for" over a 1-element tuple to create a named binding, but it's much uglier, has more overhead, and readability is basically non-existent).
- misnome 8y agoI agree that's a good feature, but feel it's hard to make comprehension examples that look elegant enough to avoid obvious sniping about how the feature makes it "unreadable".