2.2.5. Writing code for Python 2 and 3¶
Because Python 2.7 and 3 are similar, and because many people still use Python 2, we recommend writing code that is compatible with both Python 2.7 and 3. Furthermore, we recommend using the future
and six
to write code that is compatible with both Python 2.7 and 3. http://python-future.org provides helpful summaries of the differences between Python 2.7 and 3, and how to write code that is compatible with both Python 2.7 and 3.