News for hackers. Stuff that matters.
Re:Python is not a great programming language by fiedzia on Saturday October 12, 2019 @09:10PM (#21237550)
> dic = {k: v for k, v in dic.items() if k in other_dic and v == "bar"}

dic.iter().filter(|k, v| other_dic.contains(k) && v == "bar").collect();

it's one line, though I'd format it as 3 for readability (list comprehension is hard to read and functional style composes better.

There are no comments on this comment yet.