Re: dict diff

2010-11-20 Thread Jin Yi
+, Steven D'Aprano wrote: > On Sat, 20 Nov 2010 01:11:53 -0500, Steve Holden wrote: > > > On 11/19/2010 8:58 PM, Jin Yi wrote: > >> so i came up with a diff method to compare 2 dicts. > [...] > > A PEP *and* some explanation of why you would want such an obscur

Re: dict diff

2010-11-19 Thread Jin Yi
at 01:11:53AM -0500, Steve Holden wrote: > On 11/19/2010 8:58 PM, Jin Yi wrote: > > 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

dict diff

2010-11-19 Thread Jin Yi
x27;d take a pep, no? -- Jin Yi __author__ = 'razamatan_retral_net_ignore_com' from collections import Mapping def diffdict(left, right): ''' returns the deep diff of two dicts. the return value the tuple (left_diff, right_diff) >>> diffdict(1, None) (