Chapter 1. Picking an Interpreter
The State of Python 2 Versus Python 3
When choosing a Python interpreter, one looming question is always present: “Should I choose Python 2 or Python 3?” The answer is not as obvious as one might think (although 3 is becoming more compelling every day).
Here is the state of things:
-
Python 2.7 has been the standard for a long time.
-
Python 3 introduced major changes to the language, which some developers are unhappy with.1
-
Python 2.7 will receive necessary security updates until 2020.
-
Python 3 is continually evolving, like Python 2 did in years past.
You can now see why this is not such an easy decision.
Recommendations
The way we see it, a truly hoopy frood2 would use Python 3. But if you can only use Python 2, at least you’re still using Python. These are our recommendations:
- Use Python 3 if…
-
-
You love Python 3.
-
You don’t know which one to use.
-
You embrace change.
-
- Use Python 2 if…
-
-
You love Python 2 and are saddened by the future being Python 3.
-
The stability requirements of your software would be impacted.3
-
Software that you depend on requires it.
-
So…3?
If you’re choosing a Python interpreter to use, and aren’t opinionated, then use the newest Python 3.x—every version brings new and improved standard library modules, security, and bug fixes. Progress is progress. So only use Python 2 if you have a strong reason to, such as a Python 2–exclusive library that has no adequate Python 3–ready alternative, a need for ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access