def firstof(parser, token):
 bits = token.split_contents()[1:]
 if (len(bits) < 1):
  raise TemplateSyntaxError("'firstof' statement requires at least one argument")
 return FirstOfNode([parser.compile_filter(bit) for bit in bits])

def firstof ( parser , token ) : bits = token . split_contents ( ) [ 1 : ] if ( len ( bits ) < 1 ) : raise TemplateSyntaxError ( "'firstof' statement requires at least one argument" ) return FirstOfNode ( [ parser . compile_filter ( bit ) for bit in bits ] )
this is the future version of firstof with auto-escaping .