For Python >=3.9, the method Random.sample() is deprecated for sets. According to the documentation, "In the future, the population must be a sequence. Instances of set are no longer supported. The set must first be converted to a list or tuple, preferably in a deterministic order so that the sample is reproducible."
In node classes that implement a random selection between their neighbors (for example EL), the method is defined as follows:
With:
self.rng
being the Random library.self.my_neighbors
being a set of neighbors.For Python >=3.9, the method
Random.sample()
is deprecated for sets. According to the documentation, "In the future, the population must be a sequence. Instances of set are no longer supported. The set must first be converted to a list or tuple, preferably in a deterministic order so that the sample is reproducible."