Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.090 X-Spam-Evidence: '*H*': 0.85; '*S*': 0.03; 'json': 0.07; 'cc:addr :python-list': 0.11; 'emit': 0.16; 'gpg': 0.16; 'nan': 0.16; 'semantically': 0.16; 'wayne': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'trying': 0.19; 'seems': 0.21; '>>>': 0.22; 'cc:addr:python.org': 0.22; 'string,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'that.': 0.31; '>>>>': 0.31; 'fri,': 0.33; 'sense': 0.34; 'received:google.com': 0.35; 'there': 0.35; 'url:org': 0.36; 'represent': 0.38; 'pm,': 0.38; 'even': 0.60; 'no.': 0.61; 'from:charset:utf-8': 0.61; 'simply': 0.61; 'more': 0.64; '2013,': 0.91; 'edwards': 0.91; 'to:none': 0.92; 'url:tk': 0.95; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:cc:content-type; bh=yQ5wztnKocX7d9s4lh/Tja/DTJuHZKmoyx1TC5CZMHw=; b=Rfq9SrV1JCPlQN6fVSGGHJmHb1PAMhMu74VaU+IlaX0xehTPaiqNfylMhqq2nONjXM 7CXYW9J/LnRVs5QFUnOIfZiDtw88Qh7gCafoH/BLchNNnfpokVWE7CW1NweU4OPL7k2p Dtj8S1JCC+HfbkDl9Kpy3DnYetl/60qMGDtvFlOs2kQvIyI6L7ALtzwS/gwREBEr1JrI tJ4msCIvvBqhQ/o4XEIPuH1X/SaZ9MoHYet2+jWLx+0whb3NKX1iZK2MjT9fH8J43ic2 /Pqwf3q+WZpeCESSh7+8BxTVdzr1TYcrU/co9DMmspGIeGTJTOzIaVF/7koXOrOSsatz ey0w== X-Received: by 10.50.17.71 with SMTP id m7mr9963263igd.14.1366395729681; Fri, 19 Apr 2013 11:22:09 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: =?UTF-8?B?Q2hyaXMg4oCcS3dwb2xza2HigJ0gV2Fycmljaw==?= Date: Fri, 19 Apr 2013 20:21:49 +0200 Subject: Re: Encoding NaN in JSON Cc: python-list@python.org Content-Type: text/plain; charset=UTF-8 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1366395732 news.xs4all.nl 2229 [2001:888:2000:d::a6]:49109 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:43925 On Fri, Apr 19, 2013 at 4:54 PM, Grant Edwards wrote: > On 2013-04-18, Wayne Werner wrote: >> On Wed, 17 Apr 2013, Miki Tebeka wrote: >> >>>>> I'm trying to find a way to have json emit float('NaN') as 'N/A'. >>>> No. There is no way to represent NaN in JSON. It's simply not part of the >>>> specification. >>> I know that. I'm trying to emit the *string* 'N/A' for every NaN. >> >> Why not use `null` instead? It seems to be semantically more similar... > > Why not use 'NaN' instead? It seems to be even more semantically > similar... Because there is no NaN in JSON? Unless you mean a string, which makes no semantical sense and is human-oriented and not machine-oriented. -- Kwpolska | GPG KEY: 5EAAEA16 stop html mail | always bottom-post http://asciiribbon.org | http://caliburn.nl/topposting.html