On 5/17/2010 12:53 AM, Carl Banks wrote:

Even if we were to modify the set type at the C level to support it, I
can't think of an easy way to get a random element without selection
bias.

At the C level, a (hashed) set is a list with empty slots. So the C function would have to pick random ints in the appropriate range until it got an index for a non-empty slot. A sequence of selections from equal sets would not, in general, be reproducible, since the internal array need not be the same.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to