This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jfine2358
Recipients jfine2358, josh.r, remi.lapeyre, vstinner
Date 2019-01-10.12:18:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1547122728.81.0.875373312208.issue35698@roundup.psfhosted.org>
In-reply-to
Content
I read PEP 450 as saying that statistics.py can be used by "any secondary school student". This is not true for most Python libraries.

In this context, the difference between a float and an int is important. Consider
   statistics.median([2] * n)

As a secondary school student, knowing the definition of median, I might expect the value to be 2, for any n > 0. What else could it be. However, the present code gives 2 for n odd, and 2.0 for n even.

I think that this issue is best approached by taking the point of view of a secondary school student. Or perhaps even a primary school student who knows fractions. (A teacher might use statistics.py to create learning materials.)

By the way, 2 and 2.0 are not interchangeable. For example
>>> [1] * 2.0
TypeError: can't multiply sequence by non-int of type 'float'
History
Date User Action Args
2019-01-10 12:18:49jfine2358setrecipients: + jfine2358, vstinner, josh.r, remi.lapeyre
2019-01-10 12:18:48jfine2358setmessageid: <1547122728.81.0.875373312208.issue35698@roundup.psfhosted.org>
2019-01-10 12:18:48jfine2358linkissue35698 messages
2019-01-10 12:18:48jfine2358create