class Parse(object):
    """A generator that iterates through a CC-CEDICT formatted file, returning
    a tuple of parsed results (Traditional, Simplified, Pinyin, English)"""

def __init__(self, path):
    self.path = path

def __is_comment(self, line):
    return line.startswith('#')

def __iter__(self):
    with open(self.path) as f:
        pass
Пользовательский итератор Python: закрытие файла в StopIteration