Strategy for determing difference between 2 very large dictionaries

Scott David Daniels Scott.Daniels at Acm.Org
Wed Dec 24 14:19:03 EST 2008


Gabriel Genellina wrote:
> En Wed, 24 Dec 2008 06:23:00 -0200, <python at bdurham.com> escribió:
>>  ... k1 = set(dict1.iterkeys())
> You've got an excelent explanation from Marc Rintsch. (Note that in 
> Python 3.0 keys() behaves as iterkeys() in previous versions, so the 
> above code is supposed to be written in Python 2.x)
And, in fact, a dictionary iterates its keys, so:
     k1 = set(dict1)
works in 2.4, 2.5, 2.6, and 3.0

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list