parameters: (x)
docstring: Given any object x, make a JSON-able version of x, doing as best we can.
      For some objects, sage as Sage integers, this works well.  For other
      objects which make no sense in Javascript, we get a string.
docstring_summary: Given any object x, make a JSON-able version of x, doing as best we can.
      For some objects, sage as Sage integers, this works well.  For other
      objects which make no sense in Javascript, we get a string.
docstring_tokens: Given any object x make a JSON - able version of x doing as best we can . For some objects sage as Sage integers this works well . For other objects which make no sense in Javascript we get a string .
function: def jsonable(x):
      """
      Given any object x, make a JSON-able version of x, doing as best we can.
      For some objects, sage as Sage integers, this works well.  For other
      objects which make no sense in Javascript, we get a string.
      """
      import sage.all
      try:
          json.dumps(x)
          return x
      except:
          if isinstance(x, (sage.all.Integer)):
              return int(x)
          else:
              return str(x)
function_tokens: def jsonable ( x ) : import sage . all try : json . dumps ( x ) return x except : if isinstance ( x , ( sage . all . Integer ) ) : return int ( x ) else : return str ( x )