parameters: (fi, names, sep=' ')
docstring: Return an iterator for item sequences read from a file object.
      This function reads a sequence from a file object L{fi}, and
      yields the sequence as a list of mapping objects. Each line
      (item) from the file object is split by the separator character
      L{sep}. Separated values of the item are named by L{names},
      and stored in a mapping object. Every item has a field 'F' that
      is reserved for storing features.
  
      @type   fi:     file
      @param  fi:     The file object.
      @type   names:  tuple
      @param  names:  The list of field names.
      @type   sep:    str
      @param  sep:    The separator character.
      @rtype          list of mapping objects
      @return         An iterator for sequences.
docstring_summary: Return an iterator for item sequences read from a file object.
      This function reads a sequence from a file object L{fi}, and
      yields the sequence as a list of mapping objects. Each line
      (item) from the file object is split by the separator character
      L{sep}. Separated values of the item are named by L{names},
      and stored in a mapping object. Every item has a field 'F' that
      is reserved for storing features.
docstring_tokens: Return an iterator for item sequences read from a file object . This function reads a sequence from a file object L { fi } and yields the sequence as a list of mapping objects . Each line ( item ) from the file object is split by the separator character L { sep } . Separated values of the item are named by L { names } and stored in a mapping object . Every item has a field F that is reserved for storing features .
function: def readiter(fi, names, sep=' '):
      """
      Return an iterator for item sequences read from a file object.
      This function reads a sequence from a file object L{fi}, and
      yields the sequence as a list of mapping objects. Each line
      (item) from the file object is split by the separator character
      L{sep}. Separated values of the item are named by L{names},
      and stored in a mapping object. Every item has a field 'F' that
      is reserved for storing features.
  
      @type   fi:     file
      @param  fi:     The file object.
      @type   names:  tuple
      @param  names:  The list of field names.
      @type   sep:    str
      @param  sep:    The separator character.
      @rtype          list of mapping objects
      @return         An iterator for sequences.
      """
      X = []
      for line in fi:
          line = line.strip('\n')
          if not line:
              yield X
              X = []
          else:
              fields = line.split(sep)
              if len(fields) < len(names):
                  raise ValueError(
                      'Too few fields (%d) for %r\n%s' % (len(fields), names, line))
              item = {'F': []}    # 'F' is reserved for features.
              for i in range(len(names)):
                  item[names[i]] = fields[i]
              X.append(item)
function_tokens: def readiter ( fi , names , sep = ' ' ) : X = [ ] for line in fi : line = line . strip ( '\n' ) if not line : yield X X = [ ] else : fields = line . split ( sep ) if len ( fields ) < len ( names ) : raise ValueError ( 'Too few fields (%d) for %r\n%s' % ( len ( fields ) , names , line ) ) item = { 'F' : [ ] } # 'F' is reserved for features. for i in range ( len ( names ) ) : item [ names [ i ] ] = fields [ i ] X . append ( item )