The population parameter of random.sample() must be a sequence, and automatic conversion of sets to lists is no longer supported. Also, if the sample size is larger than the population size, a ValueError is raised. (Contributed by Raymond Hettinger in bpo-40465.)
This causes crem to crash when running, as it attempts to use random.sample on a dict.keys object, which apparently is now a non-sequence type (and no longer gets automatically converted).
This is fixed by first converting to a list (or other sequence datatype) prior to calling random.sample.
per the python 3.11 documentation:
This causes crem to crash when running, as it attempts to use
random.sample
on a dict.keys object, which apparently is now a non-sequence type (and no longer gets automatically converted).This is fixed by first converting to a list (or other sequence datatype) prior to calling
random.sample
.