def readline_generator(f):
 line = f.readline()
 while line:
  (yield line)
  line = f.readline()

def readline_generator ( f ) : line = f . readline ( ) while line : ( yield line ) line = f . readline ( )
as advised in doc/library/configparser .