Differences between Python versions 3.x and 2.7

11

I'm going to start a project in the faculty related to search engines and I want to take the opportunity to also learn Python.

I do not know much about language, and my biggest question is which version, between 3.x and 2.7, has better support for strings, such as library support, and what features they offer for web development.

How do I decide which one would be best for my project?

    
asked by anonymous 19.02.2016 / 03:08

1 answer

11

Python 3 is the future and the present of Python . Both versions are kept in parallel for the time being, because version 3 was not designed to be backward compatible with existing Python 2 code. So they wanted to take care of preserving the ecosystem (libraries, frameworks, etc.) while everyone was adapting to the new version:

  

I believe that one or two versions of 2.x 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 support for 2.x, acceptance and stability of 3.0 and community provision. PEP 3000

The plan did not exactly go as planned, it took a lot of time and it did a lot of talking, but today the ecosystem around Python 3 is completely mature and Python 2 is moving toward the end of its life:

  

There is no Python 2.8 release. Version 2.8 will never be released. It's 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 does not make sense to start a new project in Python 2.

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

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

    
19.02.2016 / 19:07