JSON-encoding very long iterators

Chris Angelico rosuav at gmail.com
Wed Oct 1 18:54:56 EDT 2014


On Thu, Oct 2, 2014 at 8:01 AM, Alfred Morgan <alfred at 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 features. That won't be merged into trunk. Does your patch apply
>> to 3.x?
>>
>> ChrisA
>
> Thanks Chris, Yes I made changes to 2.7 because I'm not familiar with Python3 yet. Once I get some feedback I was going to see if someone was interested in porting it. If not I will learn and do it myself.
> The patch will not work on the 3.x code but the code is similar enough to easily port over.

Okay. At some point, you'll have to port your patch to the latest
codebase, though, as the core devs won't want to do that work
themselves.

I recommend getting familiar enough with Python 3 to be able to see if
the patch at least makes sense. (I expect it probably will.) Try out a
vanilla 3.4 or master (3.5ish), then apply your patch, and see if the
improvement is indeed visible. Assuming it is (again, I expect it will
be; JSON isn't materially different in Python 3), you can post a 3.x
patch here, and you'll have rather more interest, I think - certainly
people like me won't be applying your 2.7 patch, as that's not
something that's ever going to "actually happen".

But due to the changes of str/unicode to str/bytes in Py3, you will
find that your patch requires more than just simple tweaks. It won't
be as simple as "apply the patch and fix a merge conflict"; you'll
have to rethink your changes and apply them to the different codebase.
Unfortunately, that's just what happens when you start development on
2.7; there are differences in the code, and there's no getting around
them. It'll be much easier for you if you get familiar with Py3 and do
development there. :)

ChrisA



More information about the Python-list mailing list