[Python-Dev] readd u'' literal support in 3.3?

Terry Reedy tjreedy at udel.edu
Tue Dec 13 22:10:27 CET 2011


On 12/13/2011 2:02 PM, PJ Eby wrote:
> On Tue, Dec 13, 2011 at 11:24 AM, Antoine Pitrou <solipsis at pitrou.net
> <mailto:solipsis at pitrou.net>> wrote:
>
>     On Tue, 13 Dec 2011 15:28:31 +0100
>     "Laurence Rowe" <l at lrowe.co.uk <mailto:l at lrowe.co.uk>> wrote:
>      >
>      > The approach that most people seem to have settled on for porting
>      > libraries to Python 3 is to make a single codebase that is
>     compatible with
>      > both Python 2 and Python 3, perhaps making use of the six library.
>
>     Do you have evidence that "most" people have settled on that approach?
>     (besides the couple of library writers who have commented on this
>     thread)

I think there is clearly enough 'some' people to justify official 
support of a 2to23 (or more obscurely, 2to6, but I just got the point 
that 6=2*3). Beyond that, we don't know and don't need to know.

> I've seen more projects doing it that way than maintaining dual code
> bases.  In retrospect, it seems way more attractive than having to run a
> converter all the time, especially if I could run a "2to6" tool *once*
> and then simply write new code using six-isms
>
> Among other things, it means that:
>
> * There's only one codebase
> * If the conversion isn't perfect, you only have to fix it once
> * Line numbers are the same
> * There's no conversion step slowing down development
>
> So, I expect that if the approach is at all viable, it'll quickly become
> the One Obvious Way to do it.  In effect, 2to3 is a "purity" solution,
> but six is more like a "practicality" solution.

2to3 is the practical solution for someone converting private Python 2 
code to run on Python 3 *instead* of Python 2, without looking back. By 
the nature of things, such conversions will be private and scattered 
over the next decade or so. If 2to3 works well, we will never hear about 
them, except for the rare praise. Ditto for public code whose author 
wishes to abandon Py 2. But that seems to rare so far.

So we are really talking about upgrading public libraries and apps to 
work with Python 3 *as well as* 'recent' Python 2 versions. For that, a 
'Python23' bridge seems to work for some.

Looking ahead, there will in the future be a need for a 23to3 converter 
to remove the then extraneous bridge code. But that will need a 
semi-standard 'Python23' to work from.

-- 
Terry Jan Reedy



More information about the Python-Dev mailing list