dict diff

Discussion in 'Python' started by Jin Yi, Nov 20, 2010.

  1. Jin Yi

    Jin Yi Guest

    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?


    --
    Jin Yi
     
    Jin Yi, Nov 20, 2010
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cyril Vi?ville

    diff Process under diff users

    Cyril Vi?ville, Jun 29, 2004, in forum: Perl
    Replies:
    1
    Views:
    518
    Joe Smith
    Jun 29, 2004
  2. Berrucho
    Replies:
    2
    Views:
    655
    Infant Newbie
    Dec 5, 2003
  3. A Traveler

    Diff CSS styles for diff INPUT TYPE='s?

    A Traveler, Aug 31, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    4,940
    Steve Fulton
    Aug 31, 2004
  4. Steve Holden

    Re: dict diff

    Steve Holden, Nov 20, 2010, in forum: Python
    Replies:
    3
    Views:
    198
    geremy condra
    Nov 20, 2010
  5. Austin Ziegler

    [ANN] Diff::LCS 1.1.0, Diff::LCS 1.0.4

    Austin Ziegler, Aug 8, 2004, in forum: Ruby
    Replies:
    3
    Views:
    201
    Austin Ziegler
    Aug 9, 2004
Loading...

Share This Page