docs: def clear(self, pat=None):
          """
          Minor diversion with built-in dict here;  clear can take a glob
          style expression and remove keys based on that expression.
          """
          if pat is None:
              return self.__dict__.clear()
  
          expr = re.compile(fnmatch.translate(pat))
          for key in tuple(self.keys()):
              #make sure the key is a str first
              if isinstance(key, string_types):
                  if expr.match(key):
                      del self.__dict__[key]