code: def _check_for_int(x):
      
      try:
          y = int(x)
      except (OverflowError, ValueError):
          pass
      else:
          # There is no way in AMF0 to distinguish between integers and floats
          if x == x and y == x:
              return y
  
      return x
docs: This is a compatibility function that takes a C{float} and converts it to an
      C{int} if the values are equal.