Next / Previous / Contents / Shipman's homepage

16.1. Rank.__cmp__()

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.

nomcompile3
# - - -   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 )