[Python-ideas] Add support for version objects
storchaka at gmail.com
Fri May 27 15:04:34 EDT 2016
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().
There is a support of version objects in Perl  and .NET . There
are third-party Python implementations (, , ).
Version objects can be used for representing:
1. Version of Python itself (sys.version_info).
2. Version of OS and system libraries.
3. Static and runtime versions of wrapped libraries (zlib, expat,
sqlite, curses, Tcl/Tk, libffi, libmpdec).
4. Versions of third-party modules.
The benefit of version objects against plain strings is that version
objects are comparable with expected rules (1.2.3 < 1.10.1).
The benefit of version objects against tuples is human readable string
representation and named attributes for components.
More information about the Python-ideas