Author serhiy.storchaka
Recipients Serge Anuchin, mark.dickinson, pitrou, r.david.murray, rhettinger, serhiy.storchaka, skrah, steven.daprano, tim.peters, vstinner
Date 2015-07-12.06:57:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Unfortunately a link to Rietveld is not available for review and inlined comments.

In sample() the selected set can be initialized to {n} to avoid additional checks in the loop for large population. In the branch for small population, non-empty pool can be extended ("pool.append(pool[-1])") to avoid additional check in the loop.

In choice() I would write the condition as "i == n > 0" to avoid indexing with negative index. Custom collection can has non-standard behavior with negative indices. This doesn't add additional cost in normal case.
Date User Action Args
2015-07-12 06:57:23serhiy.storchakasetrecipients: + serhiy.storchaka, tim.peters, rhettinger, mark.dickinson, pitrou, vstinner, steven.daprano, r.david.murray, skrah, Serge Anuchin
2015-07-12 06:57:23serhiy.storchakasetmessageid: <>
2015-07-12 06:57:23serhiy.storchakalinkissue24567 messages
2015-07-12 06:57:22serhiy.storchakacreate