[Python-3000] Strategy for porting to 3.0?
"Martin v. Löwis"
martin at v.loewis.de
Wed Mar 19 14:45:24 CET 2008
> After the next SpamBayes release I plan to branch the code and work on
> porting it to Python 3.0, mostly as an experiment in porting code from
> Python 2.x to 3.x whose results I can feed back to the larger Python
> community. I'm curious about how best to approach the problem. My first
> thought is to run as many SpamBayes apps and tests as I can with the -3 flag
> and resolve as many problems as it finds. How soon before the set of
> warnings it emits stabilizes?
Define "stabilize". In the sense that existing warnings will not be
revoked anymore? That should be now already.
In the sense that no significant number of warnings will be added
anymore? Not this year, I suppose. I would expect that 2.7 still adds
new -3 warnings, to cover cases where people report porting problems
that could have been warned about.
This is particularly the case when users won't start using -3 until
> Next would be to run 2to3 to do as much other
> automatic conversion as possible. Now run it under Python 3.x and resolve
> any other issues. Should I feed the problems I discover here back to the
> community in hopes either -3 or 2to3 can be enhanced?
> Then what?
Hard to tell at the moment. Assuming you want to continue to support 2.x
and 3.x concurrently, you should come up with some strategy on how to do
One option that I envision is that you might keep all sources as 2.x,
and only convert to 3.x at installation time, or perhaps at packaging
time. I don't know whether that would work for you, or would be
attractive. If not, you either need to come up with a different
strategy, or just continue to support only 2.x, and defer switching to
3.x to the future (say, 2010).
More information about the Python-3000