[Python-ideas] statistics module in Python3.4
Wolfgang Maier
wolfgang.maier at biologie.uni-freiburg.de
Sat Feb 1 23:00:36 CET 2014
Wolfgang Maier <wolfgang.maier at ...> writes:
>
> Oscar Benjamin <oscar.j.benjamin <at> ...> writes:
> >
> > On 1 February 2014 20:10, Wolfgang Maier
> > <wolfgang.maier <at> ...> wrote:
> > > Greg Ewing <greg.ewing <at> ...> writes:
> > >
> > >>
> > >> Wolfgang Maier wrote:
> > >> > Mappings may be an excellent way of specifying frequencies and
> weights in an
> > >> > elegant way.
> > >>
> > >> That may be, but I think I'd rather have a separate
> > >> function, or a mode argument, explicitly indicating
> > >> that this is what you want. Detecting whether something
> > >> is a mapping in a duck-typed way is dodgy in general.
> > >>
> > >
> > > There should be nothing dodgy about this with the abstract base class
> Mapping.
> >
> > I agree with Greg about this. I dislike APIs that try to be too clever
> > about accepting different types of input.
It may also help to address this from the users' perspective. What possible
other use-cases could there be to pass a Mapping (let alone a Counter) to
one of the functions in statistics?
Best,
Wolfgang
More information about the Python-ideas
mailing list