Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #43796
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.027 |
| X-Spam-Evidence | '*H*': 0.95; '*S*': 0.00; 'float': 0.07; 'override': 0.09; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'function;': 0.16; 'nan': 0.16; 'overriding': 0.16; 'subclass': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'thu,': 0.19; 'code,': 0.22; 'suggested': 0.26; 'post': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; '(which': 0.31; 'though.': 0.31; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'to:addr:python-list': 0.38; 'that,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'skip:u 10': 0.60; 'read': 0.60; 'simply': 0.61; 'more': 0.64; '2013': 0.98 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=itH6XsFO2QMaQXD1Lp5I+pWDZ9PVmH0fM9hdFfG63OE=; b=gQn/JWrRXdwo0RH4prXE4hIIFXUpiRHjFvzzCtxSK+SBO6vvEQHMO220psYob80gDn am3ON259IL+/ZQowXUEPbJ/VGDpNl/GvSdEk+dAQfvxwcO6YLXRb//Dbf8xL7PKP/IlY 3GI2Y31ZpnE+UkXU+WjZtn5TQvD373e296WnKAdrKcY0aq/bUDyBG6pvBBwPVNhw2DFT mzsDGoLFgO8sUdEg5qT81XWxVfLK8xQDynrEJ4hrJOFpud8IjhomTYDYkbppKrTpaOr7 rlDeCGWzudrwcF5p056aGkr62W8GhKBoS5kTEeIfHaeHizhHIyYP0VqzclxXqi9P5Hht vVrQ== |
| MIME-Version | 1.0 |
| X-Received | by 10.58.56.161 with SMTP id b1mr6822865veq.42.1366249307418; Wed, 17 Apr 2013 18:41:47 -0700 (PDT) |
| In-Reply-To | <1040891b-d350-4304-8112-de4a383562dc@googlegroups.com> |
| References | <bf3bf709-9cca-4488-a3c7-97b066bb2adf@googlegroups.com> <k4dsm8dea0gi3gf689p94el7gc6b1vk4bh@4ax.com> <c37a3b9c-6fe8-48aa-b703-9b4f922c3969@googlegroups.com> <xjrkgehe9yo3p.fsf@gmail.com> <efca95c6-156e-4959-9d90-a67421494547@googlegroups.com> <mailman.738.1366238887.3114.python-list@python.org> <1040891b-d350-4304-8112-de4a383562dc@googlegroups.com> |
| Date | Thu, 18 Apr 2013 11:41:47 +1000 |
| Subject | Re: Encoding NaN in JSON |
| From | Chris Angelico <rosuav@gmail.com> |
| To | python-list@python.org |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| 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.747.1366249316.3114.python-list@python.org> (permalink) |
| Lines | 12 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1366249316 news.xs4all.nl 2180 [2001:888:2000:d::a6]:60613 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:43796 |
Show key headers only | View raw
On Thu, Apr 18, 2013 at 11:01 AM, Miki Tebeka <miki.tebeka@gmail.com> wrote: > [Roland] >> yes, there is: subclass+extend the JSON-encoder, see pydoc json. > Please read the original post before answering. What you suggested does not work since NaN is of float type. You may be able to override a bit more of the code, though. Check out Lib/json/encoder.py for the implementation, and have a look at the floatstr() internal function; unfortunately you can't simply subclass and override that, but perhaps overriding iterencode (which is where floatstr is defined) would do the job. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Encoding NaN in JSON Miki Tebeka <miki.tebeka@gmail.com> - 2013-04-16 17:21 -0700
Re: Encoding NaN in JSON Tim Roberts <timr@probo.com> - 2013-04-16 22:38 -0700
Re: Encoding NaN in JSON Miki Tebeka <miki.tebeka@gmail.com> - 2013-04-17 07:33 -0700
Re: Encoding NaN in JSON John Gordon <gordon@panix.com> - 2013-04-17 14:47 +0000
Re: Encoding NaN in JSON Johann Hibschman <jhibschman@gmail.com> - 2013-04-17 14:05 -0500
Re: Encoding NaN in JSON Miki Tebeka <miki.tebeka@gmail.com> - 2013-04-17 14:21 -0700
Re: Encoding NaN in JSON Roland Koebler <r.koebler@yahoo.de> - 2013-04-18 00:40 +0200
Re: Encoding NaN in JSON Miki Tebeka <miki.tebeka@gmail.com> - 2013-04-17 18:01 -0700
Re: Encoding NaN in JSON Roland Koebler <r.koebler@yahoo.de> - 2013-04-18 03:39 +0200
Re: Encoding NaN in JSON Chris Angelico <rosuav@gmail.com> - 2013-04-18 11:41 +1000
Re: Encoding NaN in JSON Chris Angelico <rosuav@gmail.com> - 2013-04-18 11:46 +1000
Re: Encoding NaN in JSON Roland Koebler <r.koebler@yahoo.de> - 2013-04-18 10:11 +0200
Re: Encoding NaN in JSON Dave Angel <d@davea.name> - 2013-04-17 17:37 -0400
Re: Encoding NaN in JSON Wayne Werner <wayne@waynewerner.com> - 2013-04-18 08:53 -0500
Re: Encoding NaN in JSON Grant Edwards <invalid@invalid.invalid> - 2013-04-19 14:54 +0000
Re: Encoding NaN in JSON Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2013-04-19 20:21 +0200
Re: Encoding NaN in JSON Grant Edwards <invalid@invalid.invalid> - 2013-04-19 19:42 +0000
Re: Encoding NaN in JSON Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2013-04-20 10:00 +0200
Re: Encoding NaN in JSON Wayne Werner <wayne@waynewerner.com> - 2013-04-22 13:53 -0500
Re: Encoding NaN in JSON Tim Roberts <timr@probo.com> - 2013-04-18 22:04 -0700
Re: Encoding NaN in JSON Robert Kern <robert.kern@gmail.com> - 2013-04-19 11:43 +0530
Re: Encoding NaN in JSON Miki Tebeka <miki.tebeka@gmail.com> - 2013-04-19 12:52 -0700
csiph-web