Index: Objects/tupleobject.c =================================================================== --- Objects/tupleobject.c (revision 84515) +++ Objects/tupleobject.c (working copy) @@ -745,8 +745,8 @@ } PyDoc_STRVAR(index_doc, -"T.index(value, [start, [stop]]) -> integer -- return first index of value.\n" -"Raises ValueError if the value is not present." +"T.index(value, [start, [stop]]) -> integer -- return first index of\n" +"value. Raises ValueError if the value is not present." ); PyDoc_STRVAR(count_doc, "T.count(value) -> integer -- return number of occurrences of value"); Index: Modules/mathmodule.c =================================================================== --- Modules/mathmodule.c (revision 84515) +++ Modules/mathmodule.c (working copy) @@ -820,20 +820,27 @@ PyDoc_STRVAR(math_##funcname##_doc, docstring); FUNC1(acos, acos, 0, - "acos(x)\n\nReturn the arc cosine (measured in radians) of x.") + "acos(x) -> float\n\n" + "Return the arc cosine (measured in radians) of x.") FUNC1(acosh, m_acosh, 0, - "acosh(x)\n\nReturn the hyperbolic arc cosine (measured in radians) of x.") + "acosh(x) -> float\n\n" + "Return the hyperbolic arc cosine (measured in radians) of x.") FUNC1(asin, asin, 0, - "asin(x)\n\nReturn the arc sine (measured in radians) of x.") + "asin(x) -> float\n\n" + "Return the arc sine (measured in radians) of x.") FUNC1(asinh, m_asinh, 0, - "asinh(x)\n\nReturn the hyperbolic arc sine (measured in radians) of x.") + "asinh(x) -> float\n\n" + "Return the hyperbolic arc sine (measured in radians) of x.") FUNC1(atan, atan, 0, - "atan(x)\n\nReturn the arc tangent (measured in radians) of x.") + "atan(x) -> float\n\n" + "Return the arc tangent (measured in radians) of x.") FUNC2(atan2, m_atan2, - "atan2(y, x)\n\nReturn the arc tangent (measured in radians) of y/x.\n" + "atan2(y, x) -> float\n\n" + "Return the arc tangent (measured in radians) of y/x.\n" "Unlike atan(y/x), the signs of both x and y are considered.") FUNC1(atanh, m_atanh, 0, - "atanh(x)\n\nReturn the hyperbolic arc tangent (measured in radians) of x.") + "atanh(x) -> float\n\n" + "Return the hyperbolic arc tangent (measured in radians) of x.") static PyObject * math_ceil(PyObject *self, PyObject *number) { static PyObject *ceil_str = NULL; @@ -851,27 +858,35 @@ } PyDoc_STRVAR(math_ceil_doc, - "ceil(x)\n\nReturn the ceiling of x as an int.\n" - "This is the smallest integral value >= x."); +"ceil(x) -> integer\n\n" +"Return the ceiling of x as an integer. This is the smallest integral\n" +"value >= x."); FUNC2(copysign, copysign, - "copysign(x, y)\n\nReturn x with the sign of y.") + "copysign(x, y) -> float\n\n" + "Return x with the sign of y.") FUNC1(cos, cos, 0, - "cos(x)\n\nReturn the cosine of x (measured in radians).") + "cos(x) -> float\n\n" + "Return the cosine of x (measured in radians).") FUNC1(cosh, cosh, 1, - "cosh(x)\n\nReturn the hyperbolic cosine of x.") + "cosh(x) -> float\n\n" + "Return the hyperbolic cosine of x.") FUNC1A(erf, m_erf, - "erf(x)\n\nError function at x.") + "erf(x) -> float\n\n" + "Error function at x.") FUNC1A(erfc, m_erfc, - "erfc(x)\n\nComplementary error function at x.") + "erfc(x) -> float\n\n" + "Complementary error function at x.") FUNC1(exp, exp, 1, - "exp(x)\n\nReturn e raised to the power of x.") + "exp(x) -> float\n\n" + "Return e raised to the power of x.") FUNC1(expm1, m_expm1, 1, - "expm1(x)\n\nReturn exp(x)-1.\n" - "This function avoids the loss of precision involved in the direct " - "evaluation of exp(x)-1 for small x.") + "expm1(x) -> float\n\n" + "Return exp(x)-1. This function avoids the loss of precision involved\n" + "in the direct evaluation of exp(x)-1 for small x.") FUNC1(fabs, fabs, 0, - "fabs(x)\n\nReturn the absolute value of the float x.") + "fabs(x) -> float\n\n" + "Return the absolute value of the float x.") static PyObject * math_floor(PyObject *self, PyObject *number) { static PyObject *floor_str = NULL; @@ -889,26 +904,35 @@ } PyDoc_STRVAR(math_floor_doc, - "floor(x)\n\nReturn the floor of x as an int.\n" - "This is the largest integral value <= x."); +"floor(x) -> integer\n\n" +"Return the floor of x as an integer. This is the largest integral\n" +"value <= x."); FUNC1A(gamma, m_tgamma, - "gamma(x)\n\nGamma function at x.") + "gamma(x) -> float\n\n" + "Return gamma function at x.") FUNC1A(lgamma, m_lgamma, - "lgamma(x)\n\nNatural logarithm of absolute value of Gamma function at x.") + "lgamma(x) -> float\n\n" + "Return natural logarithm of absolute value of Gamma function at x.") FUNC1(log1p, m_log1p, 0, - "log1p(x)\n\nReturn the natural logarithm of 1+x (base e).\n" + "log1p(x) -> float\n\n" + "Return the natural logarithm of 1+x (base e).\n" "The result is computed in a way which is accurate for x near zero.") FUNC1(sin, sin, 0, - "sin(x)\n\nReturn the sine of x (measured in radians).") + "sin(x) -> float\n\n" + "Return the sine of x (measured in radians).") FUNC1(sinh, sinh, 1, - "sinh(x)\n\nReturn the hyperbolic sine of x.") + "sinh(x) -> float\n\n" + "Return the hyperbolic sine of x.") FUNC1(sqrt, sqrt, 0, - "sqrt(x)\n\nReturn the square root of x.") + "sqrt(x) -> float\n\n" + "Return the square root of x.") FUNC1(tan, tan, 0, - "tan(x)\n\nReturn the tangent of x (measured in radians).") + "tan(x) -> float\n\n" + "Return the tangent of x (measured in radians).") FUNC1(tanh, tanh, 0, - "tanh(x)\n\nReturn the hyperbolic tangent of x.") + "tanh(x) -> float\n\n" + "Return the hyperbolic tangent of x.") /* Precision summation function as msum() by Raymond Hettinger in , @@ -1127,9 +1151,9 @@ #undef NUM_PARTIALS PyDoc_STRVAR(math_fsum_doc, -"fsum(iterable)\n\n\ -Return an accurate floating point sum of values in the iterable.\n\ -Assumes IEEE-754 floating point arithmetic."); +"fsum(iterable) -> float\n\n" +"Return an accurate floating point sum of values in the iterable.\n" +"Assumes IEEE-754 floating point arithmetic."); /* Return the smallest integer k such that n < 2**k, or 0 if n == 0. * Equivalent to floor(lg(x))+1. Also equivalent to: bitwidth_of_type - @@ -1404,9 +1428,8 @@ } PyDoc_STRVAR(math_factorial_doc, -"factorial(x) -> Integral\n" -"\n" -"Find x!. Raise a ValueError if x is negative or non-integral."); +"factorial(x) -> integer\n\n" +"Return x!. Raise a ValueError if x is negative or non-integral."); static PyObject * math_trunc(PyObject *self, PyObject *number) @@ -1433,9 +1456,9 @@ } PyDoc_STRVAR(math_trunc_doc, -"trunc(x:Real) -> Integral\n" -"\n" -"Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic method."); +"trunc(x) -> integer\n\n" +"Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic\n" +"method."); static PyObject * math_frexp(PyObject *self, PyObject *arg) @@ -1458,8 +1481,7 @@ } PyDoc_STRVAR(math_frexp_doc, -"frexp(x)\n" -"\n" +"frexp(x) -> (float, integer)\n\n" "Return the mantissa and exponent of x, as pair (m, e).\n" "m is a float and e is an int, such that x = m * 2.**e.\n" "If x is 0, m and e are both 0. Else 0.5 <= abs(m) < 1.0."); @@ -1517,8 +1539,8 @@ } PyDoc_STRVAR(math_ldexp_doc, -"ldexp(x, i)\n\n\ -Return x * (2**i)."); +"ldexp(x, i) -> float\n\n" +"Return x * (2**i)."); static PyObject * math_modf(PyObject *self, PyObject *arg) @@ -1543,10 +1565,9 @@ } PyDoc_STRVAR(math_modf_doc, -"modf(x)\n" -"\n" -"Return the fractional and integer parts of x. Both results carry the sign\n" -"of x and are floats."); +"modf(x) -> (float, float)\n\n" +"Return the fractional and integer parts of x. Both results carry the\n" +"sign of x and are floats."); /* A decent logarithm is easy to compute even for huge longs, but libm can't do that by itself -- loghelper can. func is log or log10, and name is @@ -1613,9 +1634,9 @@ } PyDoc_STRVAR(math_log_doc, -"log(x[, base])\n\n\ -Return the logarithm of x to the given base.\n\ -If the base not specified, returns the natural logarithm (base e) of x."); +"log(x[, base]) -> float\n\n" +"Return the logarithm of x to the given base. If the base not specified,\n" +"returns the natural logarithm (base e) of x."); static PyObject * math_log10(PyObject *self, PyObject *arg) @@ -1624,7 +1645,8 @@ } PyDoc_STRVAR(math_log10_doc, -"log10(x)\n\nReturn the base 10 logarithm of x."); +"log10(x) -> float\n\n" +"Return the base 10 logarithm of x."); static PyObject * math_fmod(PyObject *self, PyObject *args) @@ -1657,8 +1679,8 @@ } PyDoc_STRVAR(math_fmod_doc, -"fmod(x, y)\n\nReturn fmod(x, y), according to platform C." -" x % y may differ."); +"fmod(x, y) -> float\n\n" +"Return fmod(x, y), according to platform C. x % y may differ."); static PyObject * math_hypot(PyObject *self, PyObject *args) @@ -1699,7 +1721,8 @@ } PyDoc_STRVAR(math_hypot_doc, -"hypot(x, y)\n\nReturn the Euclidean distance, sqrt(x*x + y*y)."); +"hypot(x, y) -> float\n\n" +"Return the Euclidean distance, sqrt(x*x + y*y)."); /* pow can't use math_2, but needs its own wrapper: the problem is that an infinite result can arise either as a result of overflow @@ -1786,7 +1809,8 @@ } PyDoc_STRVAR(math_pow_doc, -"pow(x, y)\n\nReturn x**y (x to the power of y)."); +"pow(x, y) -> float\n\n" +"Return x**y (x to the power of y)."); static const double degToRad = Py_MATH_PI / 180.0; static const double radToDeg = 180.0 / Py_MATH_PI; @@ -1801,8 +1825,8 @@ } PyDoc_STRVAR(math_degrees_doc, -"degrees(x)\n\n\ -Convert angle x from radians to degrees."); +"degrees(x) -> float\n\n" +"Convert angle x from radians to degrees."); static PyObject * math_radians(PyObject *self, PyObject *arg) @@ -1814,8 +1838,8 @@ } PyDoc_STRVAR(math_radians_doc, -"radians(x)\n\n\ -Convert angle x from degrees to radians."); +"radians(x) -> float\n\n" +"Convert angle x from degrees to radians."); static PyObject * math_isfinite(PyObject *self, PyObject *arg) @@ -1827,8 +1851,8 @@ } PyDoc_STRVAR(math_isfinite_doc, -"isfinite(x) -> bool\n\n\ -Return True if x is neither an infinity nor a NaN, and False otherwise."); +"isfinite(x) -> bool\n\n" +"Return True if x is neither an infinity nor a NaN, and False otherwise."); static PyObject * math_isnan(PyObject *self, PyObject *arg) @@ -1840,8 +1864,8 @@ } PyDoc_STRVAR(math_isnan_doc, -"isnan(x) -> bool\n\n\ -Return True if x is a NaN (not a number), and False otherwise."); +"isnan(x) -> bool\n\n" +"Return True if x is a NaN (not a number), and False otherwise."); static PyObject * math_isinf(PyObject *self, PyObject *arg) @@ -1853,8 +1877,9 @@ } PyDoc_STRVAR(math_isinf_doc, -"isinf(x) -> bool\n\n\ -Return True if x is a positive or negative infinity, and False otherwise."); +"isinf(x) -> bool\n\n" +"Return True if x is a positive or negative infinity, and False\n" +"otherwise."); static PyMethodDef math_methods[] = { {"acos", math_acos, METH_O, math_acos_doc},