[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] Fwd: Custom search functionality & Python3 compati
From: |
Hin-Tak Leung |
Subject: |
Re: [ft-devel] Fwd: Custom search functionality & Python3 compatibility of 'docmaker' (Re: Freetype-devel Digest, Vol 159, Issue 29) |
Date: |
Sat, 28 Apr 2018 21:07:46 +0000 (UTC) |
I wonder why all the python-savy people on the list haven't spoken up yet.
Python 2 and 3 compatibility is not either or: the python people provide
compatability modules for that, under the __future__ namespace. Typically you do
from __future__ import <stuff>
To make your python script compatible with both . The __future__ module is
available in python 2.6 onwards and more extensive in python 2.7, and is no-op
in python 3.
There are two such examples in ghostscript 's toolbin directory, the pxl*.py
scripts. (I made those changes a few years ago).
The typical python distribution also ships two scripts, 2to3 and 3to2, to
automatically migrate scripts or flag compatibility problems between python 2
and 3. And also, please read the documentation of the 2to3 module...
Date: Sat, 28 Apr 2018 21:54:30 +0200
(CEST)
Subject: Re: [ft-devel] Fwd: Custom
search functionality & Python3
compatibility of
'docmaker'
> Is there a preference? I believe
it would be good to have the new
> code written in Python 3 because
it is in active development.
I always like a conservative and
backwards compatible approach.
However, if you can convince me that we
*must* use a Python?3 feature
not available in Python?2 I will
reconsider...
Werner
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [ft-devel] Fwd: Custom search functionality & Python3 compatibility of 'docmaker' (Re: Freetype-devel Digest, Vol 159, Issue 29),
Hin-Tak Leung <=