Skip to content

loose_version

This file contains the LooseVersion class based on the class with the same name as present in Python 3.7.4 distutils. The original class is licensed under the Python Software Foundation License Version 2. It was slightly simplified as needed to make it shorter and easier to read. In particular the following changes were made: - Subclass object directly instead of abstract Version class - Fully init the class in the constructor removing the parse method - Always set self.vstring and self.version - Shorten the comparison operators as the NotImplemented case doesn't apply anymore - Changes to documentation and formatting

LooseVersion

Bases: object

Version numbering for anarchists and software realists.

A version number consists of a series of numbers, separated by either periods or strings of letters. When comparing version numbers, the numeric components will be compared numerically, and the alphabetic components lexically.

version property

Readonly access to the parsed version (list or None)

vstring property

Readonly access to the unparsed version(-string)

is_prerelease(other, markers)

Check if this is a prerelease of other

Markers is a list of strings that denote a prerelease