Commit 6faad355 authored by Ned Batchelder's avatar Ned Batchelder Committed by Kushal Das

bpo-36908: 'This module is always available' isn't helpful. (#13297)

Makes the documentation of math and cmath module
more helpful for the beginners.
parent cbb64845
...@@ -6,13 +6,12 @@ ...@@ -6,13 +6,12 @@
-------------- --------------
This module is always available. It provides access to mathematical functions This module provides access to mathematical functions for complex numbers. The
for complex numbers. The functions in this module accept integers, functions in this module accept integers, floating-point numbers or complex
floating-point numbers or complex numbers as arguments. They will also accept numbers as arguments. They will also accept any Python object that has either a
any Python object that has either a :meth:`__complex__` or a :meth:`__float__` :meth:`__complex__` or a :meth:`__float__` method: these methods are used to
method: these methods are used to convert the object to a complex or convert the object to a complex or floating-point number, respectively, and
floating-point number, respectively, and the function is then applied to the the function is then applied to the result of the conversion.
result of the conversion.
.. note:: .. note::
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
-------------- --------------
This module is always available. It provides access to the mathematical This module provides access to the mathematical functions defined by the C
functions defined by the C standard. standard.
These functions cannot be used with complex numbers; use the functions of the These functions cannot be used with complex numbers; use the functions of the
same name from the :mod:`cmath` module if you require support for complex same name from the :mod:`cmath` module if you require support for complex
......
...@@ -1232,8 +1232,8 @@ cmath_isclose_impl(PyObject *module, Py_complex a, Py_complex b, ...@@ -1232,8 +1232,8 @@ cmath_isclose_impl(PyObject *module, Py_complex a, Py_complex b,
} }
PyDoc_STRVAR(module_doc, PyDoc_STRVAR(module_doc,
"This module is always available. It provides access to mathematical\n" "This module provides access to mathematical functions for complex\n"
"functions for complex numbers."); "numbers.");
static PyMethodDef cmath_methods[] = { static PyMethodDef cmath_methods[] = {
CMATH_ACOS_METHODDEF CMATH_ACOS_METHODDEF
......
...@@ -2759,8 +2759,8 @@ static PyMethodDef math_methods[] = { ...@@ -2759,8 +2759,8 @@ static PyMethodDef math_methods[] = {
PyDoc_STRVAR(module_doc, PyDoc_STRVAR(module_doc,
"This module is always available. It provides access to the\n" "This module provides access to the mathematical functions\n"
"mathematical functions defined by the C standard."); "defined by the C standard.");
static struct PyModuleDef mathmodule = { static struct PyModuleDef mathmodule = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment