Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!hq-usenetpeers.eweka.nl!hq-usenetpeers.eweka.nl!bcyclone03.am1.xlned.com!bcyclone03.am1.xlned.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'yet.': 0.04; 'json': 0.07; 'python3': 0.07; 'wednesday,': 0.07; '3),': 0.09; 'assuming': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '2.7': 0.14; 'changes': 0.15; 'chris,': 0.16; 'codebase,': 0.16; 'devs': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'interest,': 0.16; 'materially': 0.16; 'merged': 0.16; 'morgan': 0.16; 'porting': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'wed,': 0.18; 'thu,': 0.19; 'code,': 0.22; 'cc:addr:python.org': 0.22; 'certainly': 0.24; 'merge': 0.24; 'now?': 0.24; 'cc:2**0': 0.24; 'post': 0.26; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'patch': 0.29; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'getting': 0.31; 'easier': 0.31; '3.x': 0.31; 'there.': 0.32; 'probably': 0.32; 'core': 0.34; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'thanks': 0.36; 'similar': 0.36; 'easily': 0.37; 'feedback': 0.38; 'pm,': 0.38; 'rather': 0.38; 'expect': 0.39; 'does': 0.39; 'though,': 0.39; 'enough': 0.39; 'skip:u 10': 0.60; 'new': 0.61; 'simple': 0.61; "you're": 0.61; "you'll": 0.62; 'more': 0.64; 'different': 0.65; 'due': 0.66; 'latest': 0.67; 'yes': 0.68; 'applying': 0.72; '3.4': 0.84; 'alfred': 0.84; 'improvement': 0.84; 'subject:long': 0.84; 'subject:very': 0.91; 'to:none': 0.92; 'differences': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=yXWjgUSpfICVbv2EWc2ek57oQ6l43mWFOtXCmVb0GtY=; b=xAIjxnZ34Rqja88ZUfyOMD4C2QmBOZv2OhbI4WEwakX3tFT5jQLKoUlsLByYG+UlkF 8KDDmDejFsjZKpw2mr6O0sfLFibVYFCwPHTdBRZhU1Ukflncahs8lYM7lHmx+xaLr6Z7 NpxbvyqVzKjqcR5x7wcAddUXD/I1s5Oz1YE+KeP+aMlDFRI3xx3iijqKEgBPlkHmwZX0 rW7/9tYzjn052+D91BQgeL3LSvuvdVLCW0ID8jo9zlyRDewW8Di2tmqkHMFGro0v3t3A zYAk2TLwSVI8NB3DijCi/rxNWtBlAN2tVRwf96WpDGPT3YyaaCveaqac7s2vGop1TERD C3bg== MIME-Version: 1.0 X-Received: by 10.42.92.129 with SMTP id t1mr132667icm.59.1412204096211; Wed, 01 Oct 2014 15:54:56 -0700 (PDT) In-Reply-To: References: <4232c92a-101c-4a1b-89b2-e80d67ef7bc6@googlegroups.com> <209e604c-1a18-43ff-9358-12fb784d3d4c@googlegroups.com> Date: Thu, 2 Oct 2014 08:54:56 +1000 Subject: Re: JSON-encoding very long iterators From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1412204104 news.xs4all.nl 2846 [2001:888:2000:d::a6]:53881 X-Complaints-To: abuse@xs4all.nl X-Received-Body-CRC: 3349832432 X-Received-Bytes: 5876 Xref: csiph.com comp.lang.python:78570 On Thu, Oct 2, 2014 at 8:01 AM, Alfred Morgan 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