dict diff

J

Jin Yi

so i came up with a diff method to compare 2 dicts. i found it pretty
useful so i thought i'd share it with everyone. you can see the doctest
to check out suggested uses. since we can't modify built-ins, i
demonstrated adding a diff method to OrderedDict to show how one could
add it to your own mapping objects.

the core logic is compatible with python2 and 3 (i've only tested using
2.6.5 and 3.1.2). the doctest is suited for python3 though.


the interface is pretty straightforward. it would be awesome to have
this sucker as a method on the builtin dict, but that'd take a pep, no?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top