Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!transit4.readnews.com!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: Encoding NaN in JSON Date: Fri, 19 Apr 2013 14:54:28 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 17 Message-ID: References: NNTP-Posting-Host: dsl.comtrol.com X-Trace: reader1.panix.com 1366383268 12156 64.122.56.22 (19 Apr 2013 14:54:28 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Fri, 19 Apr 2013 14:54:28 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) Xref: csiph.com comp.lang.python:43903 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... -- Grant Edwards grant.b.edwards Yow! I want a VEGETARIAN at BURRITO to go ... with gmail.com EXTRA MSG!!