Convert some list comprehensions on tuples to dict comprehension instead