def eval_str(expr):
 from datetime import date, datetime
 if isinstance(expr, (date, datetime)):
  return repr(expr)
 return (repr(expr) if isinstance(expr, _strtypes) else str(expr))

def eval_str ( expr ) : from datetime import date , datetime if isinstance ( expr , ( date , datetime ) ) : return repr ( expr ) return ( repr ( expr ) if isinstance ( expr , _strtypes ) else str ( expr ) )
string suitable for evaluation .