Presenting recursive dict (json_diff)
Terry Reedy
tjreedy at udel.edu
Thu Oct 27 15:49:47 EDT 2011
More information about the Python-list mailing list
Thu Oct 27 15:49:47 EDT 2011
- Previous message (by thread): Presenting recursive dict (json_diff)
- Next message (by thread): Presenting recursive dict (json_diff)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 10/27/2011 4:50 AM, mcepl wrote: > Hi, > > I have here a simple script (https://gitorious.org/json_diff/mainline) > which makes a diff between two JSON files. So for JSON objects > > { > "a": 1, > "b": 2, > "son": { > "name": "Janošek" > } > } > > and > > { > "a": 2, > "c": 3, > "daughter": { > "name": "Maruška" > } > } > > it generates > > { > "append": { > "c": 3, > "daughter": { > "name": "Maruška" > } > }, > "remove": { > "b": 2, > "son": { > "name": "Janošek" > } > }, > "update": { > "a": 2 > } > } > > (obvious problems with name conflicts between internal keys and the > investigated keys will be somehow addressed later; any simple Pythonic > suggestions how?) Use '_append', etc, much like namedtuple does, for the same reason. -- Terry Jan Reedy
- Previous message (by thread): Presenting recursive dict (json_diff)
- Next message (by thread): Presenting recursive dict (json_diff)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list