On Thu, Apr 18, 2013 at 11:01 AM, Miki Tebeka <miki.teb...@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 -- http://mail.python.org/mailman/listinfo/python-list