Request for feedback on API design

Ethan Furman ethan at stoneleaf.us
Mon Dec 13 16:44:00 EST 2010


Steven D'Aprano wrote:
> I am soliciting feedback regarding the API of my statistics module:
> 
> http://code.google.com/p/pycalcstats/
> 
> 
> Specifically the following couple of issues:
> 
> (1) Multivariate statistics such as covariance have two obvious APIs:
> 
>     A pass the X and Y values as two separate iterable arguments, e.g.: 
>       cov([1, 2, 3], [4, 5, 6])
> 
>     B pass the X and Y values as a single iterable of tuples, e.g.:
>       cov([(1, 4), (2, 5), (3, 6)]
> 
> I currently support both APIs. Do people prefer one, or the other, or 
> both? If there is a clear preference for one over the other, I may drop 
> support for the other.
> 

Don't currently need/use stats, but B seems clearer to me.

~Ethan~



More information about the Python-list mailing list