Dans l'hypothèse, il y a une corresponding sampled_from()
strategy-random.choice()
:échantillonnage aléatoire avec hypothèse
In [1]: from hypothesis import find, strategies as st
In [2]: find(st.sampled_from(('ST', 'LT', 'TG', 'CT')), lambda x: True)
Out[2]: 'ST'
Mais, est-il un moyen d'avoir random.sample()
-comme stratégie pour produire des séquences de longueur N sur une séquence?
In [3]: import random
In [4]: random.sample(('ST', 'LT', 'TG', 'CT'), 2)
Out[4]: ['CT', 'TG']
Beaucoup plus simple, merci beaucoup encore! – alecxe