def rev_elements(getter, action):
 for element in getter()[::(-1)]:
  action(element)
  print line

def rev_elements ( getter , action ) : for element in getter ( ) [ : : ( - 1 ) ] : action ( element ) print line
template skeleton that iterates items in reverse order .