'inverting' a dict

Jeff Epler jepler at unpythonic.net
Tue Dec 30 16:54:33 EST 2003


Does this listcomp give the right result?
    dict([(v, k) for k, vs in original.iteritems() for v in vs])

Jeff





More information about the Python-list mailing list