Feb-08-2020, 05:25 AM
Do you really want the tuple in the set, or do you actually want a set of the individual values?
In any case, you're right, the idea of ordering doesn't make sense for a set (or dict). Ordering has been sacrificed for speed - checking whether an item is in a set can be done in constant time, as opposed to linear time for an unsorted list or tuple.
In any case, you're right, the idea of ordering doesn't make sense for a set (or dict). Ordering has been sacrificed for speed - checking whether an item is in a set can be done in constant time, as opposed to linear time for an unsorted list or tuple.