Next / Previous / Contents / TCC Help System / NM Tech homepage

13.6. JulianDate.__cmp__(): Compare two Julian dates

The ordinary Python comparison function.

sidereal.py
# - - -   J u l i a n D a t e . _ _ c m p _ _

    def __cmp__ ( self, other ):
        """Compare two instances.

          [ other is a JulianDate instance ->
              if  self.j < other.j ->  return a negative number
              else if self.j == other.j -> return zero
              else -> return a positive number ]
        """
        return  cmp ( self.j, other.j )