Re: JSON-encoding very long iterators

2014-10-02 Thread Alfred Morgan
On Wednesday, October 1, 2014 3:55:19 PM UTC-7, Chris Angelico wrote: At some point, you'll have to port your patch to the latest codebase Okay, done. https://github.com/Zectbumo/cpython/compare/master Iterators for JSON is now Python 3 ready. --

Re: JSON-encoding very long iterators

2014-10-02 Thread Chris Angelico
On Thu, Oct 2, 2014 at 4:05 PM, Alfred Morgan alf...@54.org wrote: On Wednesday, October 1, 2014 3:55:19 PM UTC-7, Chris Angelico wrote: At some point, you'll have to port your patch to the latest codebase Okay, done. https://github.com/Zectbumo/cpython/compare/master Iterators for JSON is

Re: JSON-encoding very long iterators

2014-10-02 Thread Alfred Morgan
Excellent, thank you. http://bugs.python.org/issue14573 -alfred -- https://mail.python.org/mailman/listinfo/python-list

Re: JSON-encoding very long iterators

2014-10-01 Thread Alfred Morgan
On Monday, September 29, 2014 7:10:18 PM UTC-7, Ian wrote: This would cause things that aren't lists to be encoded as lists. Sometimes that may be desirable, but in general if e.g. a file object sneaks its way into your JSON encode call, it is more likely correct to raise an error than to

Re: JSON-encoding very long iterators

2014-10-01 Thread Chris Angelico
On Wed, Oct 1, 2014 at 8:13 PM, Alfred Morgan alf...@54.org wrote: I added a stream flag (off by default) and also added file streaming (thanks for the idea). https://github.com/Zectbumo/cpython/compare/2.7 What do you think now? I think that you're adding features to Python 2.7, which

Re: JSON-encoding very long iterators

2014-10-01 Thread Alfred Morgan
On Wednesday, October 1, 2014 6:07:23 AM UTC-7, Chris Angelico wrote: On Wed, Oct 1, 2014 at 8:13 PM, Alfred Morgan wrote: What do you think now? I think that you're adding features to Python 2.7, which isn't getting new features. That won't be merged into trunk. Does your patch apply to

Re: JSON-encoding very long iterators

2014-10-01 Thread Chris Angelico
On Thu, Oct 2, 2014 at 8:01 AM, Alfred Morgan alf...@54.org wrote: On Wednesday, October 1, 2014 6:07:23 AM UTC-7, Chris Angelico wrote: On Wed, Oct 1, 2014 at 8:13 PM, Alfred Morgan wrote: What do you think now? I think that you're adding features to Python 2.7, which isn't getting new

JSON-encoding very long iterators

2014-09-29 Thread alfred
I would like to add the ability to JSONEncode large iterators. Right now there is no way to do this without modifying the code. The JSONEncoder.default() doc string suggests to do this: For example, to support arbitrary iterators, you could implement default like this::

Re: JSON-encoding very long iterators

2014-09-29 Thread Ian Kelly
On Mon, Sep 29, 2014 at 7:19 PM, alf...@54.org wrote: I would like to add the ability to JSONEncode large iterators. Right now there is no way to do this without modifying the code. The JSONEncoder.default() doc string suggests to do this: For example, to support arbitrary