[arch-general] python3 thoughts

Brendan Long korin43 at gmail.com
Fri Nov 12 21:39:57 CET 2010


On 11/12/2010 11:46 AM, Auguste Pop wrote:
> Considering the incompatibility in the fundamental print
> function/statement, I seriously doubt the number of python2 packages
> that can run under python3 without any modification.

But that's the easy part. 2to3 can automatically convert a lot of
things, like print x to print(x), xrange(y) to range(y) and range(z) to
list(range(z)):

2to3 -w somefile.py # converts the file to python 3 and also backs up
the original

References:
http://docs.python.org/library/2to3.html
http://diveintopython3.org/porting-code-to-python-3-with-2to3.html


More information about the arch-general mailing list