On Thu, Feb 9, 2012 at 5:33 AM, Duncan Booth <duncan.booth@invalid.invalid> wrote: > Nathan Rice <nathan.alexander.r...@gmail.com> wrote: > >> I put dicts in sets all the time. I just tuple the items, but that >> means you have to re-dict it on the way out to do anything useful with >> it. I am too lazy to write a frozendict or import one, but I would >> use it if it was a builtin. >> > I hope you sort the items before putting them in a tuple, otherwise how do > you handle two identical dicts that return their items in a different > order?
Two dicts created from the same inputs will return items in the same arbitrary order. As long as you don't insert or delete a key you're fine. Nathan -- http://mail.python.org/mailman/listinfo/python-list