ActivePython 3 from ActiveState
Try ActivePython 3
ActivePython is the industry-standard Python distribution, available for Windows, Linux and Mac OS X. Developers worldwide rely on ActivePython's completeness and ease-of-use, while corporate users protect their infrastructure and stay competitive with quality-assured ActivePython business solutions.
Organizations who rely on Solaris, AIX and HP-UX or older versions of Python across platforms trust our newest offering: ActivePython Business Edition.
About Python 3
Python 3 (a.k.a. "Python 3000" or "Py3k") is a new version of the Python language that is incompatible with the current 2.x line of releases. The language is largely the same, but many details, especially how built-in objects like dictionaries and strings work, have changed considerably, and a lot of deprecated features have finally been removed. Also, the standard library has been reorganized in a few prominent places.
Which version should I choose?
Many 3rd-party modules and extensions that you may depend upon may not yet be available for Python 3. As a result you may want to continue to use Python 2 for the time being. However, you can safely install both ActivePython 2.6 and ActivePython 3 side-by-side on your computer so that you can experiment with Python 3 while still using Python 2 for your current code.
Python 3 is Python's future, however the Python 2.x line will continue to see new releases for some time to allow for a long and smooth transition. ActivePython 2.6 is the latest ActivePython 2.x release.
Download ActivePython 3 for your platform
Python 3 has many exciting new features. We are currently providing 3.1 core release builds. Python 3.1 focuses on the stabilization and optimization of features and changes Python 3.0 introduced.
Download ActivePython 3.1.2.3 for your platform and try it out:
Release Highlights
What's New in Python 3.x is an excellent resource describing the major changes in Python 3. Some highlights:
"print" is a function
The print statement has been replaced with a print() function, with keyword arguments to replace most of the special syntax of the old print statement.
Old: print "The answer is", 2*2
New: print("The answer is", 2*2)
Old: print >>sys.stderr, "fatal error"
New: print("fatal error", file=sys.stderr)
Unicode changes
How Python handles text vs. data has changes considerably. All text is Unicode (represented by the str type), all binary data (e.g. 8-bit strings, encoded Unicode) is held in the new bytes type.
Syntax changes
Python 3 supports function argument and return value annotations. Functions can declare keyword-only arguments. Extended iterable unpacking allows code like:
a, b, *rest = some_sequence
*rest, last = some_sequence
Other syntax changes:
d = {k: v for k, v in stuff} # dictionary comprehensions
s = {"peter", "paul", "mary"} # set literals
mode = 0o755 # octal literals
mask = 0b01001111 # binary literals
data = b"marker" # bytes literals
Much more
There are many more changes in Python 3. Resources for Python 3:
- What's New in Python 3.1
- What's New in Python 3.0
- Full Python 3.1 documentation
- Python 3000 development document (PEP 3000)
Porting to Python 3
The currently suggested path for developing for both Python 2 and 3 is to maintain code for Python 2.6 and use:
- The
python -3command line option in Python 2.6 to enable warnings about Python 3 porting issues. - The
2to3source-to-source translation tool included in Python 2.6 and Python 3 distributions.