py3k concerns. An example

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Apr 21 22:01:44 EDT 2008


En Mon, 21 Apr 2008 16:42:41 -0300, Ross Ridge  
<rridge at caffeine.csclub.uwaterloo.ca> escribió:

>> Ideally, I can implement some form of cross-compatible code
>> so that I need maintain only a single code base, and I have managed to
>> do so on a number of fronts (with the help of Robert A. Clark):

Perhaps you can manage to keep your code compatible with all versions, but  
AFAIK the reccomended strategy is to write code compatible with Python 2.6  
and use the 2to3 tool to generate the 3.0 source. And *not* edit the 3.0  
code unless one wants to maintain two branches.

>> Overall, I think I'm getting off pretty easy, but then pyparsing is a
>> small module with very limited use of the standard lib.
>
> Has the standard library changed that much?  I thought was it mainly the
> deletion of old seldom used modules that happens in new releases anyways.

*and* renaming of old module names that don't follow PEP8, and merging  
others into packages for better structure.
That's another point where using the 2to3 tool is necesary -it takes care  
of such changes- unless one wants to maintain two branches.

-- 
Gabriel Genellina




More information about the Python-list mailing list