Back to index

python3.2  3.2.2
Public Member Functions
distutils.version.Version Class Reference
Inheritance diagram for distutils.version.Version:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def __repr__
def __eq__
def __ne__
def __lt__
def __le__
def __gt__
def __ge__

Detailed Description

Abstract base class for version numbering classes.  Just provides
constructor (__init__) and reproducer (__repr__), because those
seem to be the same for all version numbering classes; and route
rich comparisons to _cmp.

Definition at line 31 of file version.py.


Constructor & Destructor Documentation

def distutils.version.Version.__init__ (   self,
  vstring = None 
)

Reimplemented in distutils.version.LooseVersion.

Definition at line 38 of file version.py.

00038 
00039     def __init__ (self, vstring=None):
00040         if vstring:
00041             self.parse(vstring)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

def distutils.version.Version.__eq__ (   self,
  other 
)

Definition at line 45 of file version.py.

00045 
00046     def __eq__(self, other):
00047         c = self._cmp(other)
00048         if c is NotImplemented:
00049             return c
00050         return c == 0

Here is the call graph for this function:

Here is the caller graph for this function:

def distutils.version.Version.__ge__ (   self,
  other 
)

Definition at line 75 of file version.py.

00075 
00076     def __ge__(self, other):
00077         c = self._cmp(other)
00078         if c is NotImplemented:
00079             return c
00080         return c >= 0
00081 
00082 
00083 # Interface for version-number classes -- must be implemented
00084 # by the following classes (the concrete ones -- Version should
00085 # be treated as an abstract class).
00086 #    __init__ (string) - create and take same action as 'parse'
00087 #                        (string parameter is optional)
00088 #    parse (string)    - convert a string representation to whatever
00089 #                        internal representation is appropriate for
00090 #                        this style of version numbering
00091 #    __str__ (self)    - convert back to a string; should be very similar
00092 #                        (if not identical to) the string supplied to parse
00093 #    __repr__ (self)   - generate Python code to recreate
00094 #                        the instance
00095 #    _cmp (self, other) - compare two version numbers ('other' may
00096 #                        be an unparsed version string, or another
00097 #                        instance of your version class)
00098 

Here is the call graph for this function:

def distutils.version.Version.__gt__ (   self,
  other 
)

Definition at line 69 of file version.py.

00069 
00070     def __gt__(self, other):
00071         c = self._cmp(other)
00072         if c is NotImplemented:
00073             return c
00074         return c > 0

Here is the call graph for this function:

def distutils.version.Version.__le__ (   self,
  other 
)

Definition at line 63 of file version.py.

00063 
00064     def __le__(self, other):
00065         c = self._cmp(other)
00066         if c is NotImplemented:
00067             return c
00068         return c <= 0

Here is the call graph for this function:

def distutils.version.Version.__lt__ (   self,
  other 
)

Definition at line 57 of file version.py.

00057 
00058     def __lt__(self, other):
00059         c = self._cmp(other)
00060         if c is NotImplemented:
00061             return c
00062         return c < 0

Here is the call graph for this function:

def distutils.version.Version.__ne__ (   self,
  other 
)

Definition at line 51 of file version.py.

00051 
00052     def __ne__(self, other):
00053         c = self._cmp(other)
00054         if c is NotImplemented:
00055             return c
00056         return c != 0

Here is the call graph for this function:

def distutils.version.Version.__repr__ (   self)

Reimplemented in distutils.version.LooseVersion.

Definition at line 42 of file version.py.

00042 
00043     def __repr__ (self):
00044         return "%s ('%s')" % (self.__class__.__name__, str(self))


The documentation for this class was generated from the following file: