-2

I've dabbled a little bit in Python - not much beyond modifying other people's scripts. Now I'm considering getting into it for real, and have hit the "Choose whether to learn 3.x or 2.x" dilemma. I've read that the main issue with 3.x is the existence of a lot of legacy 2.x code which won't run with 3.x ... but that was a while ago. Is it still the case that backwards-incompatibility is an important consideration against working in Python 3.x?

Note: A similar question was asked 5 years ago:

Is it still too early to hop aboard the Python 3 train?

Community
  • 1
  • 1
einpoklum
  • 118,144
  • 57
  • 340
  • 684

2 Answers2

4

As said in python official documentation

Python 2.x is legacy, Python 3.x is the present and future of the language

And you can check this web app here (or this as @Peque suggests) for python3 library support.

Chaker
  • 1,197
  • 9
  • 22
4

In my experience, there's only a handful of libraries that are needed for using Python in the real world, and all the major ones have been ported for years and years. Most of the Python 2 only libraries are ones that have become stagnant and are no longer updated (there are probably exceptions, but none that I'm aware of).

The real question, though, is are there any libraries that you need that are Python 2.7 only? If the answer is "No" or "I don't know" then I would definitely suggest starting on Python 3.

Another factor is that it's usually quite easy to take Python 3 code and change it to run on Python 2 (if the need arises), since Python 2.7 has a lot of forwards compatible features. The reverse, taking Python 2 code and porting it to Python 3, is not nearly so clean.