def expand(self, tempsym, blocksym, iterable):
        '''
        Expand consecutively a block in a template with an iterable.

        @param tempsym: Template symbol.
        @type tempsym: str
        @param blocksym: Block symbol in the template.
        @type blocksym: str
        @param iterable: Iterable list of dictionaries whose keys and
        values resemble correspondences among symbols and their 
        values. A value in the dictionary can be a list or an iterable
        to expand recursively the block. In this case, the key of such
        value is necessary to specify explicitly block hierarchy.
        @type iterable: list or iter

        @raise PageMacroError: If unknown block is to be resolved.
        '''

        if (
            tempsym not in self.symtab
        ):
            raise PageMacroError, \
            'Unknown template (%s) cannot be resolved.' % tempsym
            
        if (
            blocksym not in self.symtab[tempsym].symtab
        ):
            raise PageMacroError, \
            'Unknown block (%s) cannot be resolved.' % blocksym

        result = []

        for symdict in iterable:
            content = self.symtab[tempsym][blocksym]

            while True:
                matobj = PageMacro.varpat.search(content)
                if matobj is None: break
                symname = matobj.group('symname')
                
                if symname in symdict:
                    if type(symdict[symname]) is str:
                        self[symname] = symdict[symname]
                    elif type(symdict[symname]) in [list, iter]:
                        self.expand(tempsym, symname, symdict[symname])
                    elif type(symdict[symname]) is dict:
                        self.expand(
                            tempsym, symname, [symdict[symname]]
                        )

                (content, _) = PageMacro.varpat.subn(
                    self.resolve(symname), content, 1
                )

            result.append(content)

        self[blocksym] = string.join(result, '')

        Expand consecutively a block in a template with an iterable.

        @param tempsym: Template symbol.
        @type tempsym: str
        @param blocksym: Block symbol in the template.
        @type blocksym: str
        @param iterable: Iterable list of dictionaries whose keys and
        values resemble correspondences among symbols and their 
        values. A value in the dictionary can be a list or an iterable
        to expand recursively the block. In this case, the key of such
        value is necessary to specify explicitly block hierarchy.
        @type iterable: list or iter

        @raise PageMacroError: If unknown block is to be resolved.
        
recipes/Python/231512_Efficient_Comfortable_HTMLTemplate/recipe-231512.py