http://hg.python.org/cpython/rev/69c91ee0b7dd
changeset: 69088:69c91ee0b7dd
branch: 3.2
parent: 69077:a00b9a5688da
user: Raymond Hettinger <python(a)rcn.com>
date: Thu Mar 31 12:04:53 2011 -0700
summary:
Add links to make the math docs more usable.
files:
Doc/library/math.rst | 30 +++++++++++++++++++++++-------
1 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/Doc/library/math.rst b/Doc/library/math.rst
--- a/Doc/library/math.rst
+++ b/Doc/library/math.rst
@@ -156,10 +156,10 @@
.. function:: expm1(x)
- Return ``e**x - 1``. For small floats *x*, the subtraction in
- ``exp(x) - 1`` can result in a significant loss of precision; the
- :func:`expm1` function provides a way to compute this quantity to
- full precision::
+ Return ``e**x - 1``. For small floats *x*, the subtraction in ``exp(x) - 1``
+ can result in a `significant loss of precision
+ <http://en.wikipedia.org/wiki/Loss_of_significance>`_\; the :func:`expm1`
+ function provides a way to compute this quantity to full precision::
>>> from math import exp, expm1
>>> exp(1e-5) - 1 # gives result accurate to 11 places
@@ -269,6 +269,9 @@
Hyperbolic functions
--------------------
+`Hyperbolic functions <http://en.wikipedia.org/wiki/Hyperbolic_function>`_
+are analogs of trigonometric functions that are based on hyperbolas
+instead of circles.
.. function:: acosh(x)
@@ -305,21 +308,34 @@
.. function:: erf(x)
- Return the error function at *x*.
+ Return the `error function <http://en.wikipedia.org/wiki/Error_function>`_ at
+ *x*.
+
+ The :func:`erf` function can be used to compute traditional statistical
+ functions such as the `cumulative standard normal distribution
+ <http://en.wikipedia.org/wiki/Normal_distribution#Cumulative_distribution_fu…>`_::
+
+ def phi(x):
+ 'Cumulative distribution function for the standard normal distribution'
+ return (1.0 + erf(x / sqrt(2.0))) / 2.0
.. versionadded:: 3.2
.. function:: erfc(x)
- Return the complementary error function at *x*.
+ Return the complementary error function at *x*. The `complementary error
+ function <http://en.wikipedia.org/wiki/Error_function>`_ is defined as
+ ``1.0 - erf(x)``. It is used for large values of *x* where a straight
+ substraction from *1* would cause a `loss of significance
+ <http://en.wikipedia.org/wiki/Loss_of_significance>`_\.
.. versionadded:: 3.2
.. function:: gamma(x)
- Return the Gamma function at *x*.
+ Return the `Gamma function<http://en.wikipedia.org/wiki/Gamma_function>` at *x*.
.. versionadded:: 3.2
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/330d3482cad8
changeset: 69094:330d3482cad8
parent: 69092:3e191db416a6
parent: 69093:7aa3f1f7ac94
user: Raymond Hettinger <python(a)rcn.com>
date: Thu Mar 31 15:46:39 2011 -0700
summary:
Issue #7796: Add link to Jan Kaliszewski's alternate constructor and ABC for named tuples.
files:
Doc/library/collections.rst | 11 +++++++++--
Misc/ACKS | 1 +
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -857,8 +857,15 @@
.. seealso::
- `Named tuple recipe <http://code.activestate.com/recipes/500261/>`_
- adapted for Python 2.4.
+ * `Named tuple recipe <http://code.activestate.com/recipes/500261/>`_
+ adapted for Python 2.4.
+
+ * `Recipe for named tuple abstract base class with a metaclass mix-in
+ <http://code.activestate.com/recipes/577629-namedtupleabc-abstract-base-clas…>`_
+ by Jan Kaliszewski. Besides providing an :term:`abstract base class` for
+ named tuples, it also supports an alternate :term:`metaclass`-based
+ constructor that is convenient for use cases where named tuples are being
+ subclassed.
:class:`OrderedDict` objects
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -452,6 +452,7 @@
Peter van Kampen
Rafe Kaplan
Jacob Kaplan-Moss
+Jan Kaliszewski
Arkady Koplyarov
Lou Kates
Hiroaki Kawai
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/7aa3f1f7ac94
changeset: 69093:7aa3f1f7ac94
branch: 3.2
parent: 69091:9797bfe8240f
user: Raymond Hettinger <python(a)rcn.com>
date: Thu Mar 31 15:46:06 2011 -0700
summary:
Issue #7796: Add link to Jan Kaliszewski's alternate constructor and ABC for named tuples.
files:
Doc/library/collections.rst | 11 +++++++++--
Misc/ACKS | 1 +
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -775,8 +775,15 @@
.. seealso::
- `Named tuple recipe <http://code.activestate.com/recipes/500261/>`_
- adapted for Python 2.4.
+ * `Named tuple recipe <http://code.activestate.com/recipes/500261/>`_
+ adapted for Python 2.4.
+
+ * `Recipe for named tuple abstract base class with a metaclass mix-in
+ <http://code.activestate.com/recipes/577629-namedtupleabc-abstract-base-clas…>`_
+ by Jan Kaliszewski. Besides providing an :term:`abstract base class` for
+ named tuples, it also supports an alternate :term:`metaclass`-based
+ constructor that is convenient for use cases where named tuples are being
+ subclassed.
:class:`OrderedDict` objects
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -449,6 +449,7 @@
Peter van Kampen
Rafe Kaplan
Jacob Kaplan-Moss
+Jan Kaliszewski
Arkady Koplyarov
Lou Kates
Hiroaki Kawai
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/3e191db416a6
changeset: 69092:3e191db416a6
parent: 69090:69f58be4688a
parent: 69091:9797bfe8240f
user: Raymond Hettinger <python(a)rcn.com>
date: Thu Mar 31 13:59:52 2011 -0700
summary:
Fix markup and wording.
files:
Doc/library/math.rst | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/Doc/library/math.rst b/Doc/library/math.rst
--- a/Doc/library/math.rst
+++ b/Doc/library/math.rst
@@ -326,8 +326,8 @@
Return the complementary error function at *x*. The `complementary error
function <http://en.wikipedia.org/wiki/Error_function>`_ is defined as
- ``1.0 - erf(x)``. It is used for large values of *x* where a straight
- substraction from *1* would cause a `loss of significance
+ ``1.0 - erf(x)``. It is used for large values of *x* where a subtraction
+ from one would cause a `loss of significance
<http://en.wikipedia.org/wiki/Loss_of_significance>`_\.
.. versionadded:: 3.2
@@ -335,7 +335,8 @@
.. function:: gamma(x)
- Return the `Gamma function<http://en.wikipedia.org/wiki/Gamma_function>` at *x*.
+ Return the `Gamma function <http://en.wikipedia.org/wiki/Gamma_function>`_ at
+ *x*.
.. versionadded:: 3.2
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/9797bfe8240f
changeset: 69091:9797bfe8240f
branch: 3.2
parent: 69088:69c91ee0b7dd
user: Raymond Hettinger <python(a)rcn.com>
date: Thu Mar 31 13:59:24 2011 -0700
summary:
Fix markup and wording.
files:
Doc/library/math.rst | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/Doc/library/math.rst b/Doc/library/math.rst
--- a/Doc/library/math.rst
+++ b/Doc/library/math.rst
@@ -326,8 +326,8 @@
Return the complementary error function at *x*. The `complementary error
function <http://en.wikipedia.org/wiki/Error_function>`_ is defined as
- ``1.0 - erf(x)``. It is used for large values of *x* where a straight
- substraction from *1* would cause a `loss of significance
+ ``1.0 - erf(x)``. It is used for large values of *x* where a subtraction
+ from one would cause a `loss of significance
<http://en.wikipedia.org/wiki/Loss_of_significance>`_\.
.. versionadded:: 3.2
@@ -335,7 +335,8 @@
.. function:: gamma(x)
- Return the `Gamma function<http://en.wikipedia.org/wiki/Gamma_function>` at *x*.
+ Return the `Gamma function <http://en.wikipedia.org/wiki/Gamma_function>`_ at
+ *x*.
.. versionadded:: 3.2
--
Repository URL: http://hg.python.org/cpython
http://hg.python.org/cpython/rev/992ca4fdaf17
changeset: 69089:992ca4fdaf17
parent: 69087:d9a1a2eb3069
parent: 69088:69c91ee0b7dd
user: Raymond Hettinger <python(a)rcn.com>
date: Thu Mar 31 12:06:47 2011 -0700
summary:
Add links to make the math docs more usable.
files:
Doc/library/math.rst | 30 +++++++++++++++++++++++-------
1 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/Doc/library/math.rst b/Doc/library/math.rst
--- a/Doc/library/math.rst
+++ b/Doc/library/math.rst
@@ -156,10 +156,10 @@
.. function:: expm1(x)
- Return ``e**x - 1``. For small floats *x*, the subtraction in
- ``exp(x) - 1`` can result in a significant loss of precision; the
- :func:`expm1` function provides a way to compute this quantity to
- full precision::
+ Return ``e**x - 1``. For small floats *x*, the subtraction in ``exp(x) - 1``
+ can result in a `significant loss of precision
+ <http://en.wikipedia.org/wiki/Loss_of_significance>`_\; the :func:`expm1`
+ function provides a way to compute this quantity to full precision::
>>> from math import exp, expm1
>>> exp(1e-5) - 1 # gives result accurate to 11 places
@@ -269,6 +269,9 @@
Hyperbolic functions
--------------------
+`Hyperbolic functions <http://en.wikipedia.org/wiki/Hyperbolic_function>`_
+are analogs of trigonometric functions that are based on hyperbolas
+instead of circles.
.. function:: acosh(x)
@@ -305,21 +308,34 @@
.. function:: erf(x)
- Return the error function at *x*.
+ Return the `error function <http://en.wikipedia.org/wiki/Error_function>`_ at
+ *x*.
+
+ The :func:`erf` function can be used to compute traditional statistical
+ functions such as the `cumulative standard normal distribution
+ <http://en.wikipedia.org/wiki/Normal_distribution#Cumulative_distribution_fu…>`_::
+
+ def phi(x):
+ 'Cumulative distribution function for the standard normal distribution'
+ return (1.0 + erf(x / sqrt(2.0))) / 2.0
.. versionadded:: 3.2
.. function:: erfc(x)
- Return the complementary error function at *x*.
+ Return the complementary error function at *x*. The `complementary error
+ function <http://en.wikipedia.org/wiki/Error_function>`_ is defined as
+ ``1.0 - erf(x)``. It is used for large values of *x* where a straight
+ substraction from *1* would cause a `loss of significance
+ <http://en.wikipedia.org/wiki/Loss_of_significance>`_\.
.. versionadded:: 3.2
.. function:: gamma(x)
- Return the Gamma function at *x*.
+ Return the `Gamma function<http://en.wikipedia.org/wiki/Gamma_function>` at *x*.
.. versionadded:: 3.2
--
Repository URL: http://hg.python.org/cpython