@environmentfilter
def do_last(environment, seq):
 try:
  return iter(reversed(seq)).next()
 except StopIteration:
  return environment.undefined('No last item, sequence was empty.')

@ environmentfilter def do_last ( environment , seq ) : try : return iter ( reversed ( seq ) ) . next ( ) except StopIteration : return environment . undefined ( 'No last item, sequence was empty.' )
return the last item of a sequence .