[Tutor] Python version 2.7 or 3.0

Steven D'Aprano steve at pearwood.info
Wed Mar 13 00:23:03 CET 2013


On 13/03/13 01:20, Mike Nickey wrote:
> Hey all,
>
> I'm used to python 2.7 but I'm seeing and hearing a lot about 3.0 and
> wanted to ask a few questions.
> I'm seeing on StackOverflow that 2.7 is the standard for those that have
> libraries that haven't been ported to 3.1.2 yet. Does this mean that 2.7 is
> dead or dying? Is this just a well managed marketing campaign?


Python 2.7 is alive and well and will be supported for quite a few more years
yet. But it is a dead end. There will be no Python 2.8. It will continue to get
bug fixes for a few more years, and security updates for a few years longer,
but no new features.

Meanwhile, Python 3.3 and beyond is where the future is at. New features and
performance improvements are all aimed at 3.3.

The reason for the two parallel "current versions" is that Python 3 introduced
a few language changes which broke backward compatibility, and rearranged the
standard library to make it more consistent. Since these were big changes, it
is tricky (but not impossible!) for a single program to run under both Python
2 and Python 3. Realizing that it would take the big libraries many years to
migrate to Python 3, the Python development team committed to keeping 2.7
alive for longer than normal, so as to give people time to migrate.

I estimate that we're about half-way into the process. More than half of the
big libraries have either started, or completed, migrating to support 3.x.
At least one Linux distribution uses Python 3 as their system Python, and most
of the others provide it as an optional extra. So, maybe another 4-5 years of
life in Python 2.7?

If you are just starting out, and have no prerequisites about external libraries,
you should stick with Python 3.3. Please do not use Python 3.0, it is slow and
buggy and not supported. 3.1 or 3.2 are acceptable, but if you have a choice,
go for 3.3.

If you need a specific library which does not support Python 3, then 2.7 is
acceptable.


-- 
Steven


More information about the Tutor mailing list