views:

1368

answers:

6

Does anyone have an idea how long it will take before "almost all" widely used Python libraries work with Python 3.0?

I am planning to stay on 2.X for a while because I don't want to start porting stuff over and then find that some library I already rely on or a new library I might start using doesn't work yet with py3k.

My understanding is that the py3k beta process was drawn out specifically to give library developers time to move their stuff over. Has this been happening?

Examples of the sorts of libraries I am talking about would be PIL, numpy/ scipy, SQLAlchemy, BeautifulSoup, CherryPy...

+4  A: 

The examples you have listed will probably be ported very quickly, as they are so widely used.

I would be surprised if BeautifulSoup takes more than a month (In fact, I'm surprised it hasn't been ported already using the py3k betas), more complex things like numpy may take a big longer, especially because 2to3 only works on python sources, not C modules..

It's hard to generalise - some modules may never be ported, some may take days, others may take years. It could end up being a situation along the lines of "well I'm not porting my library to Python3, no one is using it!"/"Well I'm not porting my project to python3, no libraries have been updated yet!", but I hope not!

dbr
I think you were a little hasty in declaring that NumPy would be ported soon. It's now six months later and it still hasn't been ported to 2.6 completely.
David Locke
I said it may take "longer" to port numpy.. although you're right, I was a bit over-optimistic.. I don't think even BeautifulSoup has been ported yet (I moved a project I was using it in to ElementTree because of this)
dbr
+1  A: 

Some comments I saw in the CherryPy repository is that some of the changes to the sockets module are going to require an extensive reworking of the logic. I expect CherryPy will be slower than some of the other projects to get ported to 3.0.

torial
+2  A: 

Actually, the reply to your question depends on the actions of so many different people (all the maintainers of libraries outside the Python std lib), that I think that no-one can give you a reliable answer to your question.

That said, you've had already some answers, and you will have more. We agree on one thing, though: as a rule of thumb, I typically suggest that important projects (related to work, mainly) should not be ported immediately to new development technologies (Python 3, .Net 3.x, etc) until such answers as yours have already been answered and many of the initial bugs have been solved.

For pet or test projects, though, I'm all in for updates and experimentation.

ΤΖΩΤΖΙΟΥ
+1  A: 

The general idea in the migration plan is to stay on 2.x and then slowly change the code to 3.x. You will have at least 1.5 years to worry about it in. Of course there's the chicken and egg problem though.

jlouis
+1  A: 

I remember Adrian (BFDL of django) saying that Guido had given them a time frame of 5 years to port.

Lakshman Prasad
A: 

The libraries you mention will be ported once someone puts some serious time into porting them.

In the specific case of NumPy/SciPy, a large part of the code is written as C extensions. There is no 2to3 tool for C extensions and so it will take a large amount of man hours to port the code over to the format that cPython3 C extensions need to use.

David Locke