[Python-ideas] Add support for version objects

Donald Stufft donald at stufft.io
Fri May 27 15:37:55 EDT 2016


> On May 27, 2016, at 3:04 PM, Serhiy Storchaka <storchaka at gmail.com> wrote:
> 
> I propose to add support for version objects in the stdlib. Version object is a namedtuple-like object with special attrbutes major, minor, etc for representing semantic version in the form used by most open source (and not only) software. The sys module already contains two version objects: sys.version_info and the result of sys.getwindowsversion().


If Python adds a version objection, it should not be one that implements SemVer, but one that implements PEP 440 which is what PyPI, pip, setuptools, etc all use. SemVer, while a nice idea, is too simplistic to represent the variations of versioning that the Python community uses.

There’s also a pure Python implementation of it available [1].

To be honest though, I don’t see a lot of benefit to adding it to the standard library.

[1] http://packaging.readthedocs.io/en/latest/version/

—
Donald Stufft





More information about the Python-ideas mailing list