Next / Previous / Contents / Shipman's homepage

7.3. Hier.formRank(), Hier.genusRank(), Hier.speciesRank(), and Hier.subgenusRank()

Each of these methods looks for a given rank and returns the Rank instance with the appropriate code, if there is one. It returns None if there is no rank with that code.

xnomo3.py
# - - -   H i e r . f o r m R a n k   - - -
# - - -   H i e r . g e n u s R a n k   - - -
# - - -   H i e r . s p e c i e s R a n k   - - -
# - - -   H i e r . s u b g e n u s R a n k   - - -

    def formRank ( self ):
        """Return self's form rank, or None if there isn't one.
        """
        return self.__rankCodeMap.get ( FORM_RANK_CODE, None )

    def genusRank ( self ):
        """Return self's genus rank, or None if there isn't one.
        """
        return self.__rankCodeMap.get ( GENUS_RANK_CODE, None )

    def speciesRank ( self ):
        """Return self's species rank, or None if there isn't one.
        """
        return self.__rankCodeMap.get ( SPECIES_RANK_CODE, None )

    def subgenusRank ( self ):
        """Return self's subgenus rank, or None if there isn't one.
        """
        return self.__rankCodeMap.get ( SUBGENUS_RANK_CODE, None )