• withal's avatar
    Refactor CountingProbDist: · 7be52df7
    withal a écrit
     * Use weighted_sampler() for the sampling.
     * By not using a defaultdict, keep n_obs always up to date.
     * Don't inherit from ProbDist, at least for now, since we don't
       use anything from the superclass, and if we did it would break
       (e.g. __setitem__).
     * Remove __len__ since nobody uses it.
     * Use heapq.nlargest.
    
    Also separate random doctests from others, and tweak docs.
    7be52df7