Package distutils :: Module version :: Class LooseVersion
[hide private]
[frames] | no frames]

_ClassType LooseVersion

Version --+
          |
         LooseVersion

Version numbering for anarchists and software realists.
Implements the standard interface for version number classes as
described above.  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.  The following
are all valid version numbers, in no particular order:

    1.5.1
    1.5.2b2
    161
    3.10a
    8.02
    3.4j
    1996.07.12
    3.2.pl0
    3.1.1.6
    2g6
    11g
    0.960923
    2.2beta29
    1.13++
    5.5.kw
    2.0b1pl0

In fact, there is no such thing as an invalid version number under
this scheme; the rules for comparison are simple and predictable,
but may not always give the results you want (for some definition
of "want").

Instance Methods [hide private]
 
__init__(self, vstring=None)
 
parse(self, vstring)
 
__str__(self)
 
__repr__(self)
 
__cmp__(self, other)
Class Variables [hide private]
  component_re = re.compile(r'(?x)(\d+|[a-z]+|\.)')
Method Details [hide private]

__init__(self, vstring=None)
(Constructor)

 
Overrides: Version.__init__

__repr__(self)
(Representation operator)

 
Overrides: Version.__repr__