Inverse of dict(zip(x,y))

Benjamin Peterson benjamin at python.org
Wed Mar 4 17:53:30 EST 2009


Andre Engels <andreengels <at> gmail.com> writes:
> y = d.values() might also work, but I am not sure whether d.keys() and
> d.values() are guaranteed to use the same order.

They are for the builtin dictionary type, but that requirement does not extend
to any other mapping type. (It's not a requirement of the Mapping interface.)






More information about the Python-list mailing list