Retain Python 2.6 syntax compatibility

Dict and set comprehensions aren't available in Python 2.6.