Next / Previous / Contents / Shipman's homepage

15.3. Hier.__iter__(): Iterator for ranks

Because self.__rankList is a list containing the ranks in order from higher to lower, here we can simply return an iterator for that list.

nomcompile3
# - - -   H i e r . _ _ i t e r _ _

    def __iter__ ( self ):
        '''Return an iterator over self's ranks.
        '''
        return iter(self.__rankList)