code: def decimal_default(obj):
      
      if isinstance(obj, decimal.Decimal):
          if obj % 1:
              return float(obj)
          return int(obj)
      raise TypeError
docs: Properly parse out the Decimal datatypes into proper int/float types.