def iter_elements(getter, action):
 for element in getter():
  action(element)
  print line

def iter_elements ( getter , action ) : for element in getter ( ) : action ( element ) print line
template skeleton that iterates items .