replace dict comprehensions with python 2.6 compatible code