Implementation of dict comprehension