class documentation
class Shuffler: (source)
This class implements shuffling with a special consistency property. Consistency means that, for a given seed and key function, if two sets of items are shuffled, the resulting order will agree on the intersection of the two sets. For example, if items are removed from an original set, the shuffled order for the new set will be the shuffled order of the original set restricted to the smaller set.
Method | __init__ |
Undocumented |
Method | shuffle |
Return a new list of the items in a shuffled order. |
Class Variable | hash |
Undocumented |
Instance Variable | seed |
Undocumented |
Instance Variable | seed |
Undocumented |
Property | seed |
Undocumented |
Class Method | _hash |
Undocumented |
Method | _hash |
Undocumented |
Return a new list of the items in a shuffled order. The `key` is a function that accepts an item in `items` and returns a string unique for that item that can be viewed as a string id. The order of the return value is deterministic. It depends on the seed and key function but not on the original order.