def terminal_eval(source):
 node = ast.parse(source, '<source>', mode='eval')
 try:
  return _terminal_value(node.body)
 except ValueError:
  raise
  raise ValueError(('%r is not a terminal constant' % source))

def terminal_eval ( source ) : node = ast . parse ( source , '<source>' , mode = 'eval' ) try : return _terminal_value ( node . body ) except ValueError : raise raise ValueError ( ( '%r is not a terminal constant' % source ) )
evaluate a python constant source .