Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed3.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'indexing': 0.07; 'tests.': 0.07; 'bytes.': 0.09; 'conversions': 0.09; 'english,': 0.09; 'parsing': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'strings.': 0.09; 'things,': 0.09; 'variable,': 0.09; 'runs': 0.10; 'python': 0.11; 'jan': 0.12; '2.7': 0.14; "'from": 0.16; '__future__': 0.16; 'conditional': 0.16; 'escapes': 0.16; 'internally': 0.16; 'porting': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'slice,': 0.16; 'subject:python': 0.16; 'index': 0.16; 'wrote:': 0.18; 'differ': 0.19; 'producing': 0.19; 'seems': 0.21; 'import': 0.22; 'tests': 0.22; 'header:User-Agent:1': 0.23; 'instance,': 0.24; 'integer': 0.24; 'passes': 0.24; 'unicode': 0.24; 'fairly': 0.24; 'pass': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; '(like': 0.30; 'compared': 0.30; 'especially': 0.30; 'code': 0.31; 'produces': 0.31; 'python2.7': 0.31; 'compatible': 0.32; 'text': 0.33; "can't": 0.35; 'etc': 0.35; 'operations': 0.35; 'but': 0.35; 'version': 0.36; 'doing': 0.36; 'effort': 0.37; 'so,': 0.37; 'two': 0.37; 'easily': 0.37; 'machines': 0.38; 'others.': 0.38; 'handle': 0.38; 'whatever': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'rather': 0.38; 'does': 0.39; 'pdf': 0.39; 'to:addr:python.org': 0.39; 'changed': 0.39; 'system.': 0.39; 'either': 0.39; 'received:org': 0.40; 'space': 0.40; 'even': 0.60; 'skip:u 10': 0.60; 'subject:"': 0.60; 'new': 0.61; 'received:173': 0.61; 'simple': 0.61; 'making': 0.63; 'more': 0.64; 'between': 0.67; 'default': 0.69; 'article': 0.77; '2.7.': 0.84; 'received:fios.verizon.net': 0.84; 'russian,': 0.84; 'superiority': 0.84; 'abstracts': 0.91; 'increases': 0.91; 'thing,': 0.91; 'imagine': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Blog "about python 3" Date: Thu, 02 Jan 2014 13:37:16 -0500 References: <52c1dc4c$0$2877$c3e8da3$76491128@news.astraweb.com> <52C1F5EC.3020808@stoneleaf.us> <52c29416$0$29987$c3e8da3$5496439d@news.astraweb.com> <52C5A3BA.5080700@chamonix.reportlab.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-254-207.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: <52C5A3BA.5080700@chamonix.reportlab.co.uk> 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: 53 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1388687856 news.xs4all.nl 2832 [2001:888:2000:d::a6]:39804 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62996 On 1/2/2014 12:36 PM, Robin Becker wrote: > I just spent a large amount of effort porting reportlab to a version > which works with both python2.7 and python3.3. I have a large number of > functions etc which handle the conversions that differ between the two > pythons. I am imagine that this was not fun. [For those who do not know, reportlab produces pdf documents.] > For fairly sensible reasons we changed the internal default to use > unicode rather than bytes. Do you mean 'from __future__ import unicode_literals'? Am I correct in thinking that this change increases the capabilities of reportlab? For instance, easily producing an article with abstracts in English, Arabic, Russian, and Chinese? > After doing all that and making the tests > compatible etc etc I have a version which runs in both and passes all > its tests. However, for whatever reason the python 3.3 version runs slower. Python 3 is slower in some things, like integer arithmetic with small ints. > 2.7 Ran 223 tests in 66.578s > > 3.3 Ran 223 tests in 75.703s > > I know some of these tests are fairly variable, but even for simple > things like paragraph parsing 3.3 seems to be slower. Since both use > unicode internally it can't be that can it, or is python 2.7's unicode > faster? The new unicode implementation in 3.3 is faster for some operations and slower for others. It is definitely more space efficient, especially compared to a wide build system. It is definitely less buggy, especially compared to a narrow build system. Do your tests use any astral (non-BMP) chars? If so, do they pass on narrow 2.7 builds (like on Windows)? > So far the superiority of 3.3 escapes me, For one thing, indexing and slicing just works on all machines for all unicode strings. Code for 2.7 and 3.3 either a) does not index or slice, b) does not work for all text on 2.7 narrow builds, or c) has extra conditional code only for 2.7. -- Terry Jan Reedy