title: Use kwargs as key in dictionary
body: <p>I have a method which retrieves kwargs and future.
  I would like to save a dictionary of kwargs to future for later processing future result with kwargs.</p>
  
  <pre><code>class ThreadPoolExecutorImproved(object):
  
  def __init__(self, max_workers):
      self._executor = ThreadPoolExecutor(max_workers)
      self._futures = {}
  
  def __enter__(self):
      return self
  
  def __exit__(self, exc_type, exc_val, exc_tb):
      kwargs_to_exception = {}
      for kwargs, future in self._futures.iteritems():
          if future.exception():
              kwargs_to_exception[kwargs] = future.exception
  
      if kwargs_to_exception:
          raise ThreadPoolException(kwargs_to_exception)
  
  def submit(self, fn, *args, **kwargs):
      future = self._executor.submit(fn, *args, **kwargs)
      key = tuple(kwargs.items())
      self._futures[key] = future
      return future
  </code></pre>
  
  <p>However, I get an error on the line <code>self.futures[key] = future</code>:</p>
  
  <pre><code>TypeError: unhashable type: 'dict' for python
  </code></pre>
  
  <p>why is it? I created a tuple from kwargs!</p>