13 Apr
2016
13 Apr
'16
2:32 a.m.
On 13 April 2016 at 06:29, Joao S. O. Bueno
Maybe, instead of all of this, since as put by others, hardly there would be a "one size fits all" - the nice thing to have would be a "choice" or "randompop" method for sets.
Given that your choice method for sets would be little more than value = random.choice(tuple(s)) it seems like it's probably overkill to build it into Python - particularly as doing so restricts the implementation to Python 3.6+ whereas writing it out by hand works for any version. It also makes the complexity of the operation explicit, which is a good thing. Paul