Message333374
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' |
|
Date |
User |
Action |
Args |
2019-01-10 12:18:49 | jfine2358 | set | recipients:
+ jfine2358, vstinner, josh.r, remi.lapeyre |
2019-01-10 12:18:48 | jfine2358 | set | messageid: <1547122728.81.0.875373312208.issue35698@roundup.psfhosted.org> |
2019-01-10 12:18:48 | jfine2358 | link | issue35698 messages |
2019-01-10 12:18:48 | jfine2358 | create | |
|