feat(python): Add support for python 3.11rc and testing
This commit is contained in:
parent
82767e7b3c
commit
2eefd8b3f7
3 changed files with 5 additions and 3 deletions
|
|
@ -26,10 +26,11 @@ class SimpleRadio(object):
|
|||
return
|
||||
|
||||
def pick(self, choices, previous_choices=[]):
|
||||
return random.sample(set(choices).difference(previous_choices), 1)[0]
|
||||
possible_choices = [x for x in choices if x not in previous_choices]
|
||||
return random.sample(possible_choices, 1)[0]
|
||||
|
||||
def pick_many(self, choices, quantity):
|
||||
return random.sample(set(choices), quantity)
|
||||
return random.sample(list(choices), quantity)
|
||||
|
||||
def weighted_pick(self, choices, previous_choices=[]):
|
||||
total = sum(weight for c, weight in choices)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue