57c57 < "SystemRandom", "weighted_choice"] --- > "SystemRandom"] 254d253 < 268c267 < def weighted_choice(self, data, amount=1): --- > def weighted_choice(self, data): 296c295 < # yield u --- > yield u 300,301d298 < results = [] < 303,306c300,301 < for i in range(0,amount): < u = self.random() < results.append(_bisect(cumulative_dist, u)) < return results --- > for u in iter(self.random, None): > yield _bisect(cumulative_dist, u) 308,311c303,304 < for i in range(0,amount): < u = self.random() < results.append(indices[_bisect(cumulative_dist, u)]) < return results --- > for u in iter(self.random, None): > yield indices[_bisect(cumulative_dist, u)] 784d776 < weighted_choice = _inst.weighted_choice