Python 3
Python 3 was born out of necessity. One of Python 2's major annoyances was its inconsistent handling of non-English characters (commonly manifested as the infamous UnicodeDecodeError
exception). Guido initiated the Python 3 project to clean up a number of such language issues while breaking backward compatibility.
The first alpha release of Python 3.0 was made in August 2007. Since then, Python 2 and Python 3 have been in parallel development by the core development team for a number of years. Ultimately, Python 3 is expected to be the future of the language.
Python 3 for Djangonauts
This section covers the most important changes in Python 3 from a Django developer's perspective. For the full list of changes, please refer to the recommended reading section at the end of this chapter.
The examples are given in both Python 3 and Python 2. Depending on your installation, all Python 3 commands might need to be changed from python
to python3
or python3.4
.