parameters: (expr,astr,parseCompatible)
return_statement: return res
docstring: Returns a string representing this expression, where astr is a list of strings
      representing each argument
docstring_summary: Returns a string representing this expression, where astr is a list of strings
      representing each argument
docstring_tokens: Returns a string representing this expression where astr is a list of strings representing each argument
function: def _prettyPrintExpr(expr,astr,parseCompatible):
      """Returns a string representing this expression, where astr is a list of strings
      representing each argument"""
      if not isinstance(expr,OperatorExpression):
          return exprToStr(expr,parseCompatible)
      if len(expr.functionInfo.printers) > 0:
          if parseCompatible and 'parse' in expr.functionInfo.printers:
              return expr.functionInfo.printers['parse'](expr,astr)
          if not parseCompatible and 'str' in expr.functionInfo.printers:
              return expr.functionInfo.printers['str'](expr,astr)
      if expr.functionInfo.name in _prefix_operators:
          prefix = _prefix_operators[expr.functionInfo.name]
          assert len(expr.args) == 1,"Weird, prefix operator %s has %d arguments? %s"%(expr.functionInfo.name,len(astr),",".join(astr))
          return prefix + astr[0]
      if expr.functionInfo.name in _infix_operators:
          assert len(expr.args) == 2,"Weird, infix operator %s has %d arguments? %s"%(expr.functionInfo.name,len(astr),",".join(astr))
          return astr[0] + _infix_operators[expr.functionInfo.name] + astr[1]
      if expr.functionInfo.name == 'setitem':
          vconst = to_const(expr.args[0])
          iconst = to_const(expr.args[1])
          if vconst is not None and iconst is not None:
              if hasattr(iconst,'__iter__'):
                  indexset = set(iconst)
                  if parseCompatible:
                      astr[0] = '[' + ','.join(['0' if i in indexset else str(v) for i,v in enumerate(vconst)])+']'
                  else:
                      astr[0] = '[' + ','.join(['*' if i in indexset else str(v) for i,v in enumerate(vconst)])+']'
      if expr.functionInfo.name == 'getitem':
          if isinstance(expr.args[0],OperatorExpression) and astr[0][0] != '(' and expr.args[0].functionInfo.name in _infix_operators:
              astr[0] = '(' + astr[0] + ')'
          #if expr.functionInfo.name == 'getslice':
          #    if len(astr) <= 2:
          #        astr.append('')
          #    if len(astr) <= 3:
          #        astr.append('')
          #    return astr[0] + '[%s:%s:%s]'%(astr[1],astr[2],astr[3])
          if isinstance(expr.args[1],slice):
              start,stop,step = expr.args[1].start,expr.args[1].stop,expr.args[1].step
              if expr.args[1].stop > 90000000000:
                  astr[1] = str(start)+":"
              else:
                  astr[1] = str(start)+":"+str(expr.args[1].stop)
              if step is not None:
                  astr[1] = astr[1] + ":" + str(step)
          return astr[0] + '[' +astr[1] + ']'
      #default
      if len(astr) > 1 and sum(len(a) for a in astr) > 80-2-len(expr.functionInfo.name):
          res = expr.functionInfo.name + "("
          res += ',\n  '.join([indent(a,2) for a in astr]) + ')'
      else:
          res = expr.functionInfo.name + "("
          res += ','.join(astr) + ')'
      return res
function_tokens: def _prettyPrintExpr ( expr , astr , parseCompatible ) : if not isinstance ( expr , OperatorExpression ) : return exprToStr ( expr , parseCompatible ) if len ( expr . functionInfo . printers ) > 0 : if parseCompatible and 'parse' in expr . functionInfo . printers : return expr . functionInfo . printers [ 'parse' ] ( expr , astr ) if not parseCompatible and 'str' in expr . functionInfo . printers : return expr . functionInfo . printers [ 'str' ] ( expr , astr ) if expr . functionInfo . name in _prefix_operators : prefix = _prefix_operators [ expr . functionInfo . name ] assert len ( expr . args ) == 1 , "Weird, prefix operator %s has %d arguments? %s" % ( expr . functionInfo . name , len ( astr ) , "," . join ( astr ) ) return prefix + astr [ 0 ] if expr . functionInfo . name in _infix_operators : assert len ( expr . args ) == 2 , "Weird, infix operator %s has %d arguments? %s" % ( expr . functionInfo . name , len ( astr ) , "," . join ( astr ) ) return astr [ 0 ] + _infix_operators [ expr . functionInfo . name ] + astr [ 1 ] if expr . functionInfo . name == 'setitem' : vconst = to_const ( expr . args [ 0 ] ) iconst = to_const ( expr . args [ 1 ] ) if vconst is not None and iconst is not None : if hasattr ( iconst , '__iter__' ) : indexset = set ( iconst ) if parseCompatible : astr [ 0 ] = '[' + ',' . join ( [ '0' if i in indexset else str ( v ) for i , v in enumerate ( vconst ) ] ) + ']' else : astr [ 0 ] = '[' + ',' . join ( [ '*' if i in indexset else str ( v ) for i , v in enumerate ( vconst ) ] ) + ']' if expr . functionInfo . name == 'getitem' : if isinstance ( expr . args [ 0 ] , OperatorExpression ) and astr [ 0 ] [ 0 ] != '(' and expr . args [ 0 ] . functionInfo . name in _infix_operators : astr [ 0 ] = '(' + astr [ 0 ] + ')' #if expr.functionInfo.name == 'getslice': #    if len(astr) <= 2: #        astr.append('') #    if len(astr) <= 3: #        astr.append('') #    return astr[0] + '[%s:%s:%s]'%(astr[1],astr[2],astr[3]) if isinstance ( expr . args [ 1 ] , slice ) : start , stop , step = expr . args [ 1 ] . start , expr . args [ 1 ] . stop , expr . args [ 1 ] . step if expr . args [ 1 ] . stop > 90000000000 : astr [ 1 ] = str ( start ) + ":" else : astr [ 1 ] = str ( start ) + ":" + str ( expr . args [ 1 ] . stop ) if step is not None : astr [ 1 ] = astr [ 1 ] + ":" + str ( step ) return astr [ 0 ] + '[' + astr [ 1 ] + ']' #default if len ( astr ) > 1 and sum ( len ( a ) for a in astr ) > 80 - 2 - len ( expr . functionInfo . name ) : res = expr . functionInfo . name + "(" res += ',\n  ' . join ( [ indent ( a , 2 ) for a in astr ] ) + ')' else : res = expr . functionInfo . name + "(" res += ',' . join ( astr ) + ')' return res