Those two controversial 2nd & 3rd paragraphs of my ch 1

Terry Reedy tjreedy at udel.edu
Wed Jan 13 15:34:11 EST 2010


On 1/13/2010 11:30 AM, Daniel Fetchinson wrote:

> Example? Just to be clear I'm looking for an example where one given
> code runs on python 2 and 3 unmodified. I think django and cheetah
> doesn't count because they simply take their python 2 code, run it
> through 2to3 which gives them a python 3 code (I could be wrong
> though). Two codes for the two python versions.

If one only edit the Py2 version and reruns 2to3 for a Py3 version, 
whenever desired, there is just *one* code base. This is what the 
developers mean when they say one code base for 2.x and 3.x.

One could even arrange for 2to3 to be used as a front end for running 
with 3.x, though caching the 3.x version until it is out-of-date is 
obviously faster.




More information about the Python-list mailing list