Next / Previous / Contents / Shipman's homepage

7.5. DayNotes.genForms(): Generate forms in phylogenetic order

This Python generator returns the sequence of BirdForm objects in order by the two-part phylogenetic key used in the self.__txMap dictionary.

birdnotes.py
# - - -   D a y N o t e s . g e n F o r m s

    def genForms ( self ):
        """Generate contained forms in phylogenetic order.
        """

        #-- 1 --
        # [ keyList  :=  keys from self.txMap in ascending order ]
        keyList  =  self.__txMap.keys()
        keyList.sort()

        #-- 2 --
        # [ generate the values from self.__txMap in order by the
        #   elements of keyList ]
        for  key in keyList:
            yield  self.__txMap[key]

        #-- 3 --
        raise StopIteration