class_docstr: Class used to ensure the hash of Sets is preserved
  whatever the order of its items.
class_docstr_tok: ["Class","used","to","ensure","the","hash","of","Sets","is","preserved","whatever","the","order","of","its","items","."]
code: def __init__(self, set_sequence):
      # Forces order of elements in set to ensure consistent hash.
      try:
          # Trying first to order the set assuming the type of elements is
          # consistent and orderable.
          # This fails on python 3 when elements are unorderable
          # but we keep it in a try as it's faster.
          self._sequence = sorted(set_sequence)
      except (TypeError, decimal.InvalidOperation):
          # If elements are unorderable, sorting them using their hash.
          # This is slower but works in any case.
          self._sequence = sorted((hash(e) for e in set_sequence))
  
imports: import pickle
  import hashlib
  import sys
  import types
  import struct
  import io
  import decimal
  from ._compat import _bytes_or_unicode, PY3_OR_LATER
label_desc: Use image node_id 1 to create a new _ConsistentSet object from inherited base classes: object with example: obj = _ConsistentSet(set_sequence)