Next / Previous / Contents / Shipman's homepage

24.4. AbTab.__iter__(): Generate all symbol table entries

nomcompile3
# - - -   A b T a b . _ _ i t e r _ _

    def __iter__ ( self ):
        '''Generate all codes in ascending order.
        '''

The sorted() function, applied to a dictionary, returns a list of the keys from that dictionary, in ascending order.

nomcompile3
        for sym in sorted(self.__abbrMap):
            yield self.__abbrMap[sym]

        raise StopIteration