Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #15055
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!news.mixmin.net!feed.xsnews.nl!border-1.ams.xsnews.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'json': 0.07; 'reason.': 0.07; 'received:verizon.net': 0.07; 'terry': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'files.': 0.09; 'am,': 0.12; 'does,': 0.16; 'pythonic': 0.16; 'reedy': 0.16; 'wrote:': 0.16; 'jan': 0.19; 'header:In-Reply-To:1': 0.22; 'etc,': 0.23; 'somehow': 0.23; 'script': 0.29; 'hi,': 0.32; 'objects': 0.32; 'to:addr:python-list': 0.33; 'header:User-Agent:1': 0.34; 'conflicts': 0.34; 'keys': 0.34; 'header:X-Complaints-To:1': 0.35; 'problems': 0.36; 'two': 0.37; 'received:org': 0.38; 'url:org': 0.38; 'subject:: ': 0.39; 'suggestions': 0.39; 'header:Mime- Version:1': 0.39; 'to:addr:python.org': 0.39; 'subject: (': 0.39; 'here': 0.65; 'investigated': 0.91 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Terry Reedy <tjreedy@udel.edu> |
| Subject | Re: Presenting recursive dict (json_diff) |
| Date | Thu, 27 Oct 2011 15:49:47 -0400 |
| References | <cb9e6eb1-b5a7-4df6-a212-4d953d3f85e5@a17g2000yqj.googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | quoted-printable |
| X-Gmane-NNTP-Posting-Host | pool-74-109-121-73.phlapa.fios.verizon.net |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20110812 Thunderbird/6.0 |
| In-Reply-To | <cb9e6eb1-b5a7-4df6-a212-4d953d3f85e5@a17g2000yqj.googlegroups.com> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2265.1319745006.27778.python-list@python.org> (permalink) |
| Lines | 54 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1319745006 news.xs4all.nl 6917 [2001:888:2000:d::a6]:36194 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:15055 |
Show key headers only | View raw
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
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Presenting recursive dict (json_diff) mcepl <mcepl@redhat.com> - 2011-10-27 01:50 -0700
Re: Presenting recursive dict (json_diff) mcepl <mcepl@redhat.com> - 2011-10-27 02:24 -0700
Re: Presenting recursive dict (json_diff) Terry Reedy <tjreedy@udel.edu> - 2011-10-27 15:49 -0400
Re: Presenting recursive dict (json_diff) Matej Cepl <mcepl@redhat.com> - 2011-10-27 22:58 +0200
Re: Presenting recursive dict (json_diff) Terry Reedy <tjreedy@udel.edu> - 2011-10-28 00:18 -0400
csiph-web