Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.037 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'duplicate': 0.07; 'json': 0.07; 'subject:file': 0.07; 'received:209.85.219': 0.09; 'cc:addr :python-list': 0.11; 'started?': 0.16; 'subject:key': 0.16; 'yaml': 0.16; 'thanks,': 0.17; 'first.': 0.19; 'python?': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'probably': 0.32; 'received:209.85': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'thanks': 0.36; 'received:209': 0.37; 'files': 0.38; 'how': 0.40; 'read': 0.60; 'real': 0.63; 'different': 0.65; 'here': 0.66; 'hints': 0.68; 'silently': 0.84; 'choice.': 0.93; 'lot,': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=76OeIOUdaBFBU/SNHC4aZqHCSQpNnA66Zb0sXEWupPY=; b=JciUJfk4EKNCQVh+Bu1FFeLej+iM+7mNpw8M5xBaHc0SnI1B9KVGyA8RWGv2evIrZ8 Kzr5NxeJZL8S1uHctF1Nw51EBo5uF0uAzYmfbWt2BznIyt3RwrBTH2puuBOVg+D255Pb PidBuoNYFjB9My/RPPbEjh+19revbmdTv2yI+NXGwC0I7DKapOXJpGV6nvg0SFofYEUx Z9m5+4glSrCw0NYEDHyzgj7t5Sgj9cFkmR406iETAOOnP1T2S8/cJnMM9RAQ77ZUGLqk dNHj/MBgdGj+GQUMEIFvIxNz97WWAu8mnvGMDGAnszJfDdntSDhZtfmgu7ECnISXK/2w e0wg== X-Received: by 10.60.79.68 with SMTP id h4mr1694715oex.39.1369834931987; Wed, 29 May 2013 06:42:11 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Jabba Laci Date: Wed, 29 May 2013 15:41:50 +0200 Subject: Re: detect key conflict in a JSON file To: Roy Smith Content-Type: text/plain; charset=ISO-8859-1 Cc: Python mailing list X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369834941 news.xs4all.nl 15921 [2001:888:2000:d::a6]:44001 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:46378 > The real answer here is that JSON is probably not the best choice for > large files that get hand-edited. For data that you intend to hand-edit > a lot, YAML might be a better choice. > >> Currently the value of the second key silently overwrites the value of >> the first. Thanks but how would it be different with YAML? Can YAML check duplicate keys? How to process (read) YAML files in Python? Can you give me some hints how to get started? All I need is read it in and create a dictionary of it. Thanks, Laszlo