Differences between Python versions 3.x and 2.7

Asked

Viewed 2,693 times

13

I will start a project in college related to search engines and want to take the opportunity to also learn Python.

I don’t know much about the language and my biggest doubt is about which version, between 3.x and 2.7, has better support for string handling, such as support for libraries, and what resources do they offer for web development.

How to decide which would be the most suitable for my project?

  • I had posted a comment here, I don’t remember having problems in the comment, but ok as I said earlier, it will vary a lot of the environment, until the @Gabe response goes straight to the problem "The 3 is the future" and soon the development of 2 will stop, but it is not because it will stop the development that will stop with security fixes and which servers and or operating systems will migrate to 3 because of the compatibility of apps. 3 is different from 2, but the important thing is to learn programming logic, then it will be easy to go from 2 to 3, Python typing is relatively easy.

  • 1

    As the question was reworked, I considered your previous comment obsolete and removed. This is now more complete, it could even be the embryo of a response...

  • 1

    @bfavaretto great suggestion, I just won’t do it yet because I’m a little busy, I like to try to provide something with higher quality. Thank you!

1 answer

14


Python 3 is the future and present of Python. The two versions are maintained in parallel, for now, because version 3 was not designed to be backward compatible with existing Python 2 code. So they wanted to take care to preserve the ecosystem (libraries, frameworks, etc.) while everyone adapted to the new version:

I believe that one or two more 2.x versions will be released, even after the release of version 3.0, probably when we are already in 3.1 or 3.2. This will also depend on the demand for continuity of 2.x support, the acceptance and stability of 3.0 and the willingness of the community.
Guido van Rossum - PEP 3000

The plan did not go exactly as planned, it took a long time and plenty to talk about, but today the ecosystem around Python 3 is fully mature and Python 2 is heading towards the end of its life:

There is no Python 2.8 release. Version 2.8 will never be released. It is an ex-release. Python 2.7 is the end of the Python 2 development line.
Barry Warsaw - PEP 0404 [announcing the extinction of Python 2.8 release plans]

It took longer than expected, but today it no longer makes sense to start a new Python 2 project.

Most of the most used libraries in python already support Python 3, and the few that do not yet have been replaced by others, already created in Python 3. You can track the progress of the adaptation to Python 3 on sites like Python 3 Readiness which lists the most popular 360 packages from Pypi. You can also use the Can I Use Python 3 to place dependencies on your project and see if the packages you use support Py3.

If you’re starting with Python now, no reason to use Python 2.
Everything you need is already available in Python 3.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.