summaryrefslogtreecommitdiffstats
path: root/Doc/library/statistics.rst
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2014-02-08 09:58:04 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2014-02-08 09:58:04 (GMT)
commit73afe2a972e30a3e0f87401be2fa38c67e2cb964 (patch)
treebf900c405b1584f00248558dad103050d5a31aaa /Doc/library/statistics.rst
parent57e41277813163a90129a8c4d5f62f0ca68793b6 (diff)
downloadcpython-73afe2a972e30a3e0f87401be2fa38c67e2cb964.zip
cpython-73afe2a972e30a3e0f87401be2fa38c67e2cb964.tar.gz
cpython-73afe2a972e30a3e0f87401be2fa38c67e2cb964.tar.bz2
Close #20481: Disallow mixed type input in statistics
The most appropriate coercion rules are not yet clear, so simply disallowing mixed type input for 3.4. (Committed on Steven's behalf)
Diffstat (limited to 'Doc/library/statistics.rst')
-rw-r--r--Doc/library/statistics.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/library/statistics.rst b/Doc/library/statistics.rst
index e6c5959..4e77838 100644
--- a/Doc/library/statistics.rst
+++ b/Doc/library/statistics.rst
@@ -20,6 +20,16 @@
This module provides functions for calculating mathematical statistics of
numeric (:class:`Real`-valued) data.
+.. note::
+
+ Unless explicitly noted otherwise, these functions support :class:`int`,
+ :class:`float`, :class:`decimal.Decimal` and :class:`fractions.Fraction`.
+ Behaviour with other types (whether in the numeric tower or not) is
+ currently unsupported. Mixed types are also undefined and
+ implementation-dependent. If your input data consists of mixed types,
+ you may be able to use :func:`map` to ensure a consistent result, e.g.
+ ``map(float, input_data)``.
+
Averages and measures of central location
-----------------------------------------