Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'yet.': 0.04; 'encoding': 0.05; 'subject:Python': 0.06; '*not*': 0.07; 'tests.': 0.07; 'string': 0.09; '2to3': 0.09; 'anticipate': 0.09; 'ascii': 0.09; 'lines.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'jan': 0.12; 'changes': 0.15; '*only*': 0.16; 'csv': 0.16; 'moving,': 0.16; 'non-ascii': 0.16; 'porting': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'utf-8)': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'library': 0.18; 'header:User-Agent:1': 0.23; 'replace': 0.24; 'unicode': 0.24; 'developers': 0.25; 'supported': 0.26; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'change,': 0.30; 'code': 0.31; 'lines': 0.31; 'easy,': 0.31; 'everywhere': 0.31; 'libraries': 0.31; "we're": 0.32; 'another': 0.32; 'trouble': 0.34; 'subject:the': 0.34; 'could': 0.34; 'but': 0.35; 'edge': 0.36; 'next': 0.36; 'should': 0.36; 'effort': 0.37; 'application': 0.37; 'needed': 0.38; 'to:addr:python-list': 0.38; 'that,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'skip:u 10': 0.60; 'company': 0.60; 'year.': 0.61; 'skip:* 10': 0.61; 'more': 0.64; 'benefit': 0.68; 'change?': 0.84; 'everywhere.': 0.84; 'received:fios.verizon.net': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Python 2 to 3 conversion - embrace the pain Date: Mon, 16 Mar 2015 13:47:41 -0400 References: <20150316025301.GA94576@cskk.homeip.net> <873855tts4.fsf@jester.gateway.sonic.net> <55068cb0$0$12923$c3e8da3$5496439d@news.astraweb.com> <8761a1gxhq.fsf@jester.gateway.sonic.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-98-114-97-173.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.19 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: 39 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1426528082 news.xs4all.nl 2849 [2001:888:2000:d::a6]:34143 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:87578 On 3/16/2015 5:13 AM, INADA Naoki wrote: > Another experience is porting Flask application in my company from > Python 2 to Python 3. > It has 26k lines of code and 7.6k lines of tests. > > Since we don't need to support both of PY2 and PY3, we used 2to3. > 2to3 changes 740 lines. That is less than 3% of the lines. Were any changes incorrect? How many lines *not* flagged by 2to3 needed change? > I had to replace google-api-client with > requests+oauthlib since > it had not supported PY3 yet. Other than those needed for this change, which 2to3 could not anticipate or handle? > After that, we encountered few trouble with untested code. But Porting > effort is surprisingly small. > We're happy now with Python 3. We can write non-ascii string to log > without fear of UnicodeError. > We can use csv with unicode without hack. People who use ascii only or perhaps one encoding everywhere severely underestimate the benefit of unicode strings (and utf-8) everywhere. > Porting *modern* *application* code to *PY3 only* is easy, while > porting libraries on the edge of > bytes/unicode like google-api-client to PY2/3 is not easy. > > I think application developers should use *only* Python 3 from this year. > If we start moving, more library developers will be able to start > writing Python 3 only code from next year. -- Terry Jan Reedy