When two ranks are compared, the comparison is by depth. A higher level is considered less than a deeper level. So, for example, Order < Family, and Genus > Family.
# - - - R a n k . _ _ c m p _ _ def __cmp__ ( self, other ): '''Sort ranks from highest (root) to deepest (leaves). ''' return cmp ( self.depth, other.depth )