-
Python - Filtering Dicts
I’ve been needing to do some Python for work lately. Nothing big or fancy, but it does involve working with lists and dicts… Coming from Elixir and Ruby I can’t help but wonder if I’m missing some greater point about how Python does this stuff. Like, why does filtering a dict not return a dict but has to be cast into one? And why are items treated like tuples in the comprehension/lambda? I know the underlying form is most likely a tuple in both Python, Elixir and Ruby, but I don’t really care to be dealing directly with it.