This is a newer feature that should probably go into the Python 3.0 doc rather than this one. Dictionary comprehensions only exist in 2.7 and will confuse many readers not using the latest and greatest.