docs: def sort_set(s):
      """Return a sorted list of the contents of a set
  
      This is intended to be used to iterate over world state, where you just need keys
      to be in some deterministic order, but the sort order should be obvious from the key.
  
      Non-strings come before strings and then tuples. Tuples compare element-wise as normal.
      But ultimately all comparisons are between values' ``repr``.
  
      This is memoized.
  
      """
      if not isinstance(s, Set):
          raise TypeError("sets only")
      s = frozenset(s)
      if s not in _sort_set_memo:
          _sort_set_memo[s] = sorted(s, key=_sort_set_key)
      return _sort_set_memo[s]