def next(self): # will raise StopIteration if no (more) facts or fallback
        try:
            self.yieldedValue = next(self.forIter)
            # set next value here as well as in for node, because may be cleared above context of for node
            self.sCtx.localVariables[self.node.name] = self.yieldedValue
            if self.sCtx.formulaOptions.traceVariableFiltersResult:
                self.sCtx.modelXbrl.info("sphinx:trace",
                     _("For loop %(variable)s: bound value %(result)s"), 
                     sourceFileLine=self.node.sourceFileLine, variable=str(self.node.name), result=str(self.yieldedValue))
        except __HOLE__:
            if self.yieldedValue is not None:
                del self.sCtx.localVariables[self.node.name]
            self.yieldedValue = None
            raise StopIteration
dataset/ETHPy150Open Arelle/Arelle/arelle/plugin/sphinx/SphinxContext.py/ForBinding.next