Skip to content

Conversation

mhucka
Copy link
Member

@mhucka mhucka commented Aug 29, 2025

Using a set in a call to the sample(…) method from the Python random standard library has been deprecated since Python 3.9, and in Python 3.11, it causes an error. This was happening in the function util.py:_apply_random_control(…) starting on line 111. Changing the set to a list in the call is probably the most efficient way of addressing this compatibility problem, and is backward-compatible with Python versions prior to 3.11.

I searched but could not find another place where a set was being passed to sample(). (There are other calls to random.sample(), but none involve sets, as far as I have been able to determine.)

mhucka added 2 commits August 29, 2025 03:34
Using a set in a call to the `sample(…)` method from the Python `random`
standard library has been deprecated since Python 3.9, and in Python
3.11, it causes an error. This was happening in the function
`util.py:_apply_random_control(…)` starting on line 111. Changing the
set to a list in the call is probably the most efficient way of
addressing this compatibility problem, and is backward-compatible with
Python versions prior to 3.11.

I searched but could not find another place where a set was being passed
to `sample()`. (There are other calls to `random.sample()`, but
none involve sets, as far as I have been able to determine.)
@mhucka mhucka marked this pull request as ready for review August 30, 2025 00:55
@mhucka mhucka added area/health Involves general matters of project configuration, health, maintenance, and similar concerns area/python Involves Python code labels Aug 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/health Involves general matters of project configuration, health, maintenance, and similar concerns area/python Involves Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant