def isfinal(elt):
 return (type(elt) in [str, int, float, unicode, datetime.datetime, REGEXP_T])

def isfinal ( elt ) : return ( type ( elt ) in [ str , int , float , unicode , datetime . datetime , REGEXP_T ] )
decides whether or not elt is a final element .