[Python-Dev] PEP 450 adding statistics module

Terry Reedy tjreedy at udel.edu
Fri Aug 16 05:13:57 CEST 2013


On 8/15/2013 10:44 PM, Steven D'Aprano wrote:

> The most obvious case is datetime: we have datetime(), and
> datetime.now(), datetime.today(), and datetime.strftime(). The only API
> difference between it and median is that datetime is a type and median
> is not, but that's a difference that makes no difference:

I and several others, see them as conceptually different in a way that 
makes a big difference. Datetime is a number structure with distinct 
properties and operations. The median of a set of values from a totally 
ordered set is the middle value (if there is an odd number). The median 
is a function and the result of the function and the type of the result 
depends on the type of the inputs. The only complication is when there 
are an even number of items and the middle two cannot be averaged. I 
presume that is what medium_low is about (pick the lower of the middle 
two). It is a variant function with a more general definition, not a 
method of a type.

None of the above have anything to do with Python implementations.

-- 
Terry Jan Reedy



More information about the Python-Dev mailing list