code: def priority(s):
      
      # REZ: Previously this value was calculated in place many times which is
      #      expensive.  Do it once early.
      # REZ: Changed this to output a list, so that can nicely sort "validate"
      #      items by the sub-priority of their schema
      type_of_s = type(s)
      if type_of_s in (list, tuple, set, frozenset):
          return [ITERABLE]
      if type_of_s is dict:
          return [DICT]
      if issubclass(type_of_s, type):
          return [TYPE]
      if hasattr(s, 'validate'):
          p = [VALIDATOR]
          if hasattr(s, "_schema"):
              p.extend(priority(s._schema))
          return p
      if callable(s):
          return [CALLABLE]
      else:
          return [COMPARABLE]
docs: Return priority for a given object.