use dict comprehension
Merge pull request #4433 from dimagi/use-dict-comprehension

use dict comprehension