Those two controversial 2nd & 3rd paragraphs of my ch 1
Alf P. Steinbach
alfps at start.no
Thu Jan 14 17:12:12 CET 2010
* Lie Ryan -> Alf P. Steinbach:
> why do you think it is "impossible" to write a complex and portable
> python script?
I don't. You're not quoting me.
> Though keeping everything in one code base may often be difficult and
> only of little practical benefit, it is not impossible. Modern version
> control systems makes creating a fork not-so-difficult; and
> maintaining two or more codebase is much cheaper nowadays than they used
> to be.
>  we're ignoring other python implementations since they haven't
> targeted 3.0; but anyway due to the much better defined standard,
> alternative implementations doesn't pose much difference except for
> occasional lack of the newest feature on many cases
>  though not, by any definition, "easy"; but at least it's often
> easier to fork than to keep things in one code base. Another, better,
> alternative is to write a program that transform a human readable code
> to portable code; which is what 2to3 is about.
The upshot for 2.x/3.x compatible code base is to write in 2.x and convert
automatically to 3.x, that is, to write the source code in *one* language.
That's because it's very hard to write code that works directly in both
languages (or language versions, if you prefer).
The paragraph in the book is about why one, in practice, has to choose one
version for one's source code, and why one shouldn't automatically think that
what's learned about that version necessarily applies to the other version.
Cheers & hth.,
More information about the Python-list