def __iter__(self):
        """Generator for looping over every line in the files in self.files.

        If __flag is set to &2, then end the generator.  Otherwise check if
        '-' (read: sys.stdin) is the next file.  Set __relative_cnt to 0 and
        start iterating.

        If __flag is set to &1, close the current file and break the loop.
        Else see if the file name equals the current file name.  If not,
        change it.  Then increment both __relative_cnt and __absolute_cnt.
        Finally, yield the line.

        """
        for file_location in self.__file_list:
            if self.__flags & 2:
                return
            if file_location == '-':
                FILE = sys.stdin
            else:
                FILE = open(file_location,'r')
            self.__relative_cnt = 0
            for line in FILE:
                if self.__flags & 1:
                    FILE.close()
                    break
                if file_location != self.__current_file:
                    self.__current_file = file_location
                self.__relative_cnt += 1
                self.__absolute_cnt += 1
                yield line
            else: FILE.close()
Generator for looping over every line in the files in self.files.

        If __flag is set to &2, then end the generator.  Otherwise check if
        '-' (read: sys.stdin) is the next file.  Set __relative_cnt to 0 and
        start iterating.

        If __flag is set to &1, close the current file and break the loop.
        Else see if the file name equals the current file name.  If not,
        change it.  Then increment both __relative_cnt and __absolute_cnt.
        Finally, yield the line.

        
recipes/Python/112506_fileinput_as_a_generator/recipe-112506.py