Skip to Content
The Hitchhiker's Guide to Python
book

The Hitchhiker's Guide to Python

by Kenneth Reitz, Tanya Schlusser
August 2016
Beginner
338 pages
7h 58m
English
O'Reilly Media, Inc.
Content preview from The Hitchhiker's Guide to Python

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

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

The Quick Python Book, Third Edition

The Quick Python Book, Third Edition

David Fugate, Naomi Ceder
Serious Python

Serious Python

Julien Danjou
Introduction to Python

Introduction to Python

Jessica McKellar

Publisher Resources

ISBN: 9781491933213Errata Page