Jonathan Fine <jfine2...@gmail.com> added the comment:

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'

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35698>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to