Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Version Numbering Scheme

I am trying to get an understanding of the different version's of Python. Currently, their website provides several different version within the download section.

I understand the distinction between Python 2.x and 3.x, and the larger confusion I am having is between different versions of Python 3.x.

For example, their website currently lists the three most recent releases as:

  • Python 3.4.6 (2017-01-17)
  • Python 3.5.3 (2017-01-17)
  • Python 3.6.0 (2016-12-23)

Clearly, the most recent release is 3.4.6, but it is not the largest release number.

What is the distinction between these three different versions? Should I install the most recent version, or the largest release number? All help is appreciated.

like image 437
ncuccia Avatar asked Feb 15 '17 20:02

ncuccia


People also ask

How do you maintain versioning in Python?

Set the value to a __version__ global variable in a specific module. Place the value in a simple VERSION text file for both setup.py and code to read. Set the value via a setup.py release, and use importlib. metadata to pick it up at runtime.

Does Python follow SemVer?

While Python doesn't fully support SemVer, you can still create three-part versions in the same manner. Semantic Versioning works by structuring each version identifier into three parts, MAJOR, MINOR, and PATCH.

How do I check the version of a python package?

To get the version of a package used in a Python script, use the __version__ attribute. The __version__ attribute is recommended by PEP (Python Enhancement Proposals), and many packages have it. Note that the __version__ attribute is not mandatory, so some packages do not have it.


1 Answers

According to this, a version number is defined by

MAJOR.MINOR.PATCH

where

  1. MAJOR version when you make incompatible API changes
  2. MINOR version when you add functionality in a backwards-compatible manner, and
  3. PATCH version when you make backwards-compatible bug fixes.

According to this and this Python 3.5.0 was released in 2015-09-13, while Python 3.4.0 was released on March 16th, 2014.

The third number in the version number is the PATCH which usually fixes bugs, so the last version of Python is 3.6.0 which has no patches so far. I recommend to use the version based on the compatibility of the libraries you are going to use.

like image 111
lmiguelvargasf Avatar answered Sep 19 '22 18:09

lmiguelvargasf