mirror of https://github.com/python/cpython
closes bpo-39415: Remove unused codes from longobject.c complexobject.c floatobject.c. (GH-18105)
This commit is contained in:
parent
47be7d0108
commit
0d5eac8c32
|
@ -731,29 +731,9 @@ complex__format__(PyObject* self, PyObject* args)
|
||||||
return _PyUnicodeWriter_Finish(&writer);
|
return _PyUnicodeWriter_Finish(&writer);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
static PyObject *
|
|
||||||
complex_is_finite(PyObject *self)
|
|
||||||
{
|
|
||||||
Py_complex c;
|
|
||||||
c = ((PyComplexObject *)self)->cval;
|
|
||||||
return PyBool_FromLong((long)(Py_IS_FINITE(c.real) &&
|
|
||||||
Py_IS_FINITE(c.imag)));
|
|
||||||
}
|
|
||||||
|
|
||||||
PyDoc_STRVAR(complex_is_finite_doc,
|
|
||||||
"complex.is_finite() -> bool\n"
|
|
||||||
"\n"
|
|
||||||
"Returns True if the real and the imaginary part is finite.");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static PyMethodDef complex_methods[] = {
|
static PyMethodDef complex_methods[] = {
|
||||||
{"conjugate", (PyCFunction)complex_conjugate, METH_NOARGS,
|
{"conjugate", (PyCFunction)complex_conjugate, METH_NOARGS,
|
||||||
complex_conjugate_doc},
|
complex_conjugate_doc},
|
||||||
#if 0
|
|
||||||
{"is_finite", (PyCFunction)complex_is_finite, METH_NOARGS,
|
|
||||||
complex_is_finite_doc},
|
|
||||||
#endif
|
|
||||||
{"__getnewargs__", (PyCFunction)complex_getnewargs, METH_NOARGS},
|
{"__getnewargs__", (PyCFunction)complex_getnewargs, METH_NOARGS},
|
||||||
{"__format__", (PyCFunction)complex__format__,
|
{"__format__", (PyCFunction)complex__format__,
|
||||||
METH_VARARGS, complex__format__doc},
|
METH_VARARGS, complex__format__doc},
|
||||||
|
|
|
@ -843,35 +843,6 @@ float_is_integer_impl(PyObject *self)
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
static PyObject *
|
|
||||||
float_is_inf(PyObject *v)
|
|
||||||
{
|
|
||||||
double x = PyFloat_AsDouble(v);
|
|
||||||
if (x == -1.0 && PyErr_Occurred())
|
|
||||||
return NULL;
|
|
||||||
return PyBool_FromLong((long)Py_IS_INFINITY(x));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
float_is_nan(PyObject *v)
|
|
||||||
{
|
|
||||||
double x = PyFloat_AsDouble(v);
|
|
||||||
if (x == -1.0 && PyErr_Occurred())
|
|
||||||
return NULL;
|
|
||||||
return PyBool_FromLong((long)Py_IS_NAN(x));
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
float_is_finite(PyObject *v)
|
|
||||||
{
|
|
||||||
double x = PyFloat_AsDouble(v);
|
|
||||||
if (x == -1.0 && PyErr_Occurred())
|
|
||||||
return NULL;
|
|
||||||
return PyBool_FromLong((long)Py_IS_FINITE(x));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*[clinic input]
|
/*[clinic input]
|
||||||
float.__trunc__
|
float.__trunc__
|
||||||
|
|
||||||
|
@ -1863,14 +1834,6 @@ static PyMethodDef float_methods[] = {
|
||||||
FLOAT_FROMHEX_METHODDEF
|
FLOAT_FROMHEX_METHODDEF
|
||||||
FLOAT_HEX_METHODDEF
|
FLOAT_HEX_METHODDEF
|
||||||
FLOAT_IS_INTEGER_METHODDEF
|
FLOAT_IS_INTEGER_METHODDEF
|
||||||
#if 0
|
|
||||||
{"is_inf", (PyCFunction)float_is_inf, METH_NOARGS,
|
|
||||||
"Return True if the float is positive or negative infinite."},
|
|
||||||
{"is_finite", (PyCFunction)float_is_finite, METH_NOARGS,
|
|
||||||
"Return True if the float is finite, neither infinite nor NaN."},
|
|
||||||
{"is_nan", (PyCFunction)float_is_nan, METH_NOARGS,
|
|
||||||
"Return True if the float is not a number (NaN)."},
|
|
||||||
#endif
|
|
||||||
FLOAT___GETNEWARGS___METHODDEF
|
FLOAT___GETNEWARGS___METHODDEF
|
||||||
FLOAT___GETFORMAT___METHODDEF
|
FLOAT___GETFORMAT___METHODDEF
|
||||||
FLOAT___SET_FORMAT___METHODDEF
|
FLOAT___SET_FORMAT___METHODDEF
|
||||||
|
|
|
@ -5411,13 +5411,6 @@ int_bit_length_impl(PyObject *self)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
static PyObject *
|
|
||||||
long_is_finite(PyObject *v)
|
|
||||||
{
|
|
||||||
Py_RETURN_TRUE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*[clinic input]
|
/*[clinic input]
|
||||||
int.as_integer_ratio
|
int.as_integer_ratio
|
||||||
|
@ -5574,10 +5567,6 @@ static PyMethodDef long_methods[] = {
|
||||||
{"conjugate", long_long_meth, METH_NOARGS,
|
{"conjugate", long_long_meth, METH_NOARGS,
|
||||||
"Returns self, the complex conjugate of any int."},
|
"Returns self, the complex conjugate of any int."},
|
||||||
INT_BIT_LENGTH_METHODDEF
|
INT_BIT_LENGTH_METHODDEF
|
||||||
#if 0
|
|
||||||
{"is_finite", (PyCFunction)long_is_finite, METH_NOARGS,
|
|
||||||
"Returns always True."},
|
|
||||||
#endif
|
|
||||||
INT_TO_BYTES_METHODDEF
|
INT_TO_BYTES_METHODDEF
|
||||||
INT_FROM_BYTES_METHODDEF
|
INT_FROM_BYTES_METHODDEF
|
||||||
INT_AS_INTEGER_RATIO_METHODDEF
|
INT_AS_INTEGER_RATIO_METHODDEF
|
||||||
|
|
Loading…
Reference in New Issue