[docs] Make the documentation for statistics' data argument clearer. (issue 27825)

efm-pythonbugs at tummy.com efm-pythonbugs at tummy.com
Fri Oct 7 13:18:33 EDT 2016


New examples using Fraction look good.

Sequence or iterator change also good.

Modifying numeric to become real-valued is a significant change in
meaning. It's more specific than is needed.


http://bugs.python.org/review/27825/diff/18782/Doc/library/statistics.rst
File Doc/library/statistics.rst (right):

http://bugs.python.org/review/27825/diff/18782/Doc/library/statistics.rst#newcode151
Doc/library/statistics.rst:151: *data* can be a sequence or iterator of
real-valued numbers.
Adding 'sequence or iterator' is the wanted change, changing 'numeric'
to 'real-valued' changes the meaning.
Real-valued is more specific than numeric. 
For example, does median work with complex numbers? with integers?

http://bugs.python.org/review/27825/diff/18782/Doc/library/statistics.rst#newcode163
Doc/library/statistics.rst:163: >>> median([F(3, 7), F(1, 21), F(5, 3),
F(1, 3)])
This is a nice choice of an example.

http://bugs.python.org/review/27825/diff/18782/Doc/library/statistics.rst#newcode183
Doc/library/statistics.rst:183: :exc:`StatisticsError` is raised. 
*data* can be a sequence or iterator
See my comment above. Real-valued may be too specific.

http://bugs.python.org/review/27825/


More information about the docs mailing list