Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!newsreader4.netcologne.de!news.netcologne.de!novso.com!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:: [': 0.04; 'static': 0.04; 'cpython': 0.05; 'subject:Python': 0.06; 'barry,': 0.07; 'pypi': 0.07; '2to3': 0.09; 'bindings': 0.09; 'worse': 0.09; 'api': 0.11; 'cc:addr:python-list': 0.11; 'python': 0.11; '(without': 0.16; 'bindings.': 0.16; "brett's": 0.16; 'feasible': 0.16; 'migration.': 0.16; 'non-python': 0.16; 'nowadays': 0.16; 'porting': 0.16; 'pypi.': 0.16; 'similarly,': 0.16; 'subject:Dev': 0.16; 'subject:edition': 0.16; 'there...': 0.16; 'underlying': 0.16; 'folks': 0.16; 'wrote:': 0.18; 'library': 0.18; 'implementing': 0.19; 'replacing': 0.19; 'subject:] ': 0.20; 'email addr:gmail.com>': 0.22; 'separate': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**1': 0.23; "aren't": 0.24; 'helpful': 0.24; '>': 0.26; 'extension': 0.26; 'header:In- Reply-To:1': 0.27; 'wondering': 0.29; "doesn't": 0.30; 'converting': 0.30; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'easier': 0.31; 'usually': 0.31; 'gcc': 0.31; 'libraries': 0.31; 'anyone': 0.31; 'linux': 0.33; 'url:python': 0.33; 'cc:no real name:2**1': 0.33; 'could': 0.34; 'point.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'version': 0.36; 'really': 0.36; 'useful': 0.36; 'url:org': 0.36; 'example,': 0.37; 'level': 0.37; 'desirable': 0.38; 'that,': 0.38; 'sure': 0.39; 'dave': 0.60; 'worry': 0.60; 'most': 0.60; 'deliver': 0.61; 'url:3': 0.61; 'high': 0.63; 'provide': 0.64; 'more': 0.64; 'to:addr:gmail.com': 0.65; 'details': 0.65; 'techniques': 0.66; 'latest': 0.67; 'covers': 0.68; '\xe2\x80\x93': 0.77; 'potentially': 0.81; '*and*': 0.84; 'employed,': 0.84; 'subject:survey': 0.84; 'updates,': 0.84 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:to :cc:content-type; bh=/JpEX/myaZ0DmPZPX5AYdDfKkp+ZcWpN65RLHUSSsCM=; b=aKcoZdA3gkdkTbmrsA6EjXyLbvRcFXag129+rUUklCTgY9vLhyuI03z8jPI9BuYVgG c/UDaJMAAAtHwbF6ElBp/oKKx2m7UHsRJUkDhZkiqO132x6Ksc1tBIoqa7Efkhn9n84W U2o9HyTD+CrV6pxi10zfXirOfC0EkBS81IPWb9Yl5Sa16WYgTUxCQ9KIp3kngRcqe3UL mgE48DHMPOg6/2y4LNNXY+3DV02hlLWfMHiwvh1D4x1F6MrZ7yPG13fDTvBcfgZ97+cu TCqTFSftkYU9dzSu5W0bxvwuDiYhcj76FNdAssqspdtW7Umrb4lzeBwQHeKOnT2r2iM3 CwBg== MIME-Version: 1.0 X-Received: by 10.66.220.134 with SMTP id pw6mr38176534pac.91.1418516082937; Sat, 13 Dec 2014 16:14:42 -0800 (PST) In-Reply-To: References: Date: Sun, 14 Dec 2014 10:14:42 +1000 Subject: Re: [Python-Dev] Python 2.x and 3.x use survey, 2014 edition From: Nick Coghlan To: Petr Viktorin Content-Type: multipart/alternative; boundary=047d7b5db9083b5865050a2203ce Cc: python-list@python.org, python-dev@python.org 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: 105 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1418516091 news.xs4all.nl 2954 [2001:888:2000:d::a6]:50917 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:82491 --047d7b5db9083b5865050a2203ce Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 13 Dec 2014 05:19, "Petr Viktorin" wrote: > > Also keep in mind that not all Python libraries are on PyPI. > For non-Python projects with Python bindings (think video players, > OpenCV, systemd, Samba), distribution via PyPI doesn't make much > sense. And since the Python bindings are usually second-class > citizens, the porting doesn't have a high priority. > > If anyone is wondering why their favorite Linux distribution is stuck > with Python 2 =E2=80=93 well, I can only speak for Fedora, but nowadays m= ost > of what's left are CPython bindings. > No pylint --py3k or 2to3 will help there... That's a good point. I actually think https://docs.python.org/3/howto/cporting.html#cporting-howto is actually in a worse state than the state the Python level porting guide was in until Brett's latest round of updates, as it covers the underlying technical details of the incompatibilities moreso than the available tools and recommended processes for *executing* a migration. For example, replacing a handcrafted Python extension with a normal C library plus cffi, Cython or SWIG generated Python bindings can deliver both an easier to maintain extension *and* Python 3 compatibility. Similarly, converting an extension from C to Cython outright (without a separate C library) can provide both benefits. It's mainly when converting to one of those isn't desirable and/or feasible that you really need to worry about C API level porting. For that, tools like Dave Malcolm's static CPython extension analyser for gcc could potentially be helpful (as pylint was to Brett's update to the Python level guide), and Lennart also provides some more detailed practical suggestions in http://python3porting.com/cextensions.html I'm sure there are other useful techniques that can be employed, but aren't necessarily well known outside the folks that have been busy implementing these migrations. Barry, Petr, any of the other folks working on distro level C extension ports, perhaps one of you would be willing to consider an update to the C extension porting guide to be more in line with Brett's latest version of the Python level porting guide? Regards, Nick. --047d7b5db9083b5865050a2203ce Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On 13 Dec 2014 05:19, "Petr Viktorin" <encukou@gmail.com> wrote:
>
> Also keep in mind that not all Python libraries are on PyPI.
> For non-Python projects with Python bindings (think video players,
> OpenCV, systemd, Samba), distribution via PyPI doesn't make much > sense. And since the Python bindings are usually second-class
> citizens, the porting doesn't have a high priority.
>
> If anyone is wondering why their favorite Linux distribution is stuck<= br> > with Python 2 =E2=80=93 well, I can only speak for Fedora, but nowaday= s most
> of what's left are CPython bindings.
> No pylint --py3k or 2to3 will help there...

That's a good point. I actually think https://docs.python.= org/3/howto/cporting.html#cporting-howto is actually in a worse state t= han the state the Python level porting guide was in until Brett's lates= t round of updates, as it covers the underlying technical details of the in= compatibilities moreso than the available tools and recommended processes f= or *executing* a migration.

For example, replacing a handcrafted Python extension with a= normal C library plus cffi, Cython or SWIG generated Python bindings can d= eliver both an easier to maintain extension *and* Python 3 compatibility.

Similarly, converting an extension from C to Cython outright= (without a separate C library) can provide both benefits.

It's mainly when converting to one of those isn't de= sirable and/or feasible that you really need to worry about C API level por= ting.

For that, tools like Dave Malcolm's static CPython exten= sion analyser for gcc could potentially be helpful (as pylint was to Brett&= #39;s update to the Python level guide), and Lennart also provides some mor= e detailed practical suggestions in http://python3porting.com/cextensions.html

I'm sure there are other useful techniques that can be e= mployed, but aren't necessarily well known outside the folks that have = been busy implementing these migrations.

Barry, Petr, any of the other folks working on distro level = C extension ports, perhaps one of you would be willing to consider an updat= e to the C extension porting guide to be more in line with Brett's late= st version of the Python level porting guide?

Regards,
Nick.

--047d7b5db9083b5865050a2203ce--