d.keys() and d.values()

Andreas Jung lists at andreas-jung.com
Tue Jun 24 06:08:27 EDT 2003


I don't think it is guaranteed but usually it works. Why don't you use 
d.items()???

-aj

--On Dienstag, 24. Juni 2003 12:03 Uhr +0200 Gerrit Holl 
<gerrit at nl.linux.org> wrote:

> Hi,
>
> is it guaranteed that dict(zip(d.keys(), d.values())) == d?
> In words, do .keys() and .values() always have the same order? Is
> it safe to rely on this?
>
> yours,
> Gerrit.
>
> --
> 279. If any one by a male or female slave, and a third party claim it,
> the seller is liable for the claim.
>         -- 1780 BC, Hammurabi, Code of Law
> --
> Asperger Syndroom - een persoonlijke benadering:
> 	http://people.nl.linux.org/~gerrit/
> Het zijn tijden om je zelf met politiek te bemoeien:
> 	http://www.sp.nl/
>
> --
> http://mail.python.org/mailman/listinfo/python-list









More information about the Python-list mailing list