Python error on GAE with Memcache - TypeError: unhashable type: 'list'
<p>I have a small Python app that produces a form, the user enters some strings in and it collects them as an array and adds (or tries to) that array as a value of a key in Google's Memcache.</p>

<p>This is the script:</p>

<pre><code>import webapp2
from google.appengine.api import memcache


MAIN_PAGE_HTML = """\
&lt;html&gt;
  &lt;body&gt;
    &lt;form action="/get" method="post"&gt;
      &lt;div&gt;&lt;input name="ID"/&gt;&lt;/div&gt;
      &lt;div&gt;&lt;input name="param1"/&gt;&lt;/div&gt;
      &lt;div&gt;&lt;input name="param2"/&gt;&lt;/div&gt;
      &lt;div&gt;&lt;input name="param3"/&gt;&lt;/div&gt;
      &lt;div&gt;&lt;input name="param4"/&gt;&lt;/div&gt;
      &lt;div&gt;&lt;input name="param5"/&gt;&lt;/div&gt;
      &lt;div&gt;&lt;input type="submit" value="Change Status"&gt;&lt;/div&gt;
    &lt;/form&gt;
  &lt;/body&gt;
&lt;/html&gt;
"""

class MainPage(webapp2.RequestHandler):
    def get(self):
        self.response.write(MAIN_PAGE_HTML)

class status(webapp2.RequestHandler):
    def post(self):
        paramarray= (self.request.get_all('param1'),
                     self.request.get_all('param2'),
                     self.request.get_all('param3'),
                     self.request.get_all('param4'),
                     self.request.get_all('param5'))
        array1 = tuple(paramarray)

        memcache.add(key=(self.request.get_all('ID')), value=array1, time=3600)


app = webapp2.WSGIApplication([
    ('/', MainPage),
    ('/get', status),
], debug=True)
</code></pre>

<p>I've tried setting <code>paramarray</code> as a tuple, not a list. Still getting the same error:</p>

<pre><code>Traceback (most recent call last):
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1535, in __call__
    rv = self.handle_exception(request, response, e)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in __call__
    rv = self.router.dispatch(request, response)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1102, in __call__
    return handler.dispatch()
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 572, in dispatch
    return self.handle_exception(e, self.app.debug)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 570, in dispatch
    return method(*args, **kwargs)
  File "/base/data/home/apps/s~gtech-iot/1.391041688070473184/main.py", line 41, in post
    memcache.add(key=(self.request.get_all('ID')), value=array1, time=3600)
  File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/memcache/__init__.py", line 785, in add
    namespace=namespace)
  File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/memcache/__init__.py", line 868, in _set_with_policy
    rpc = self._set_multi_async_with_policy(policy, {key: value},
TypeError: unhashable type: 'list'
</code></pre>

<p>Tried to set curly braces, regular, squared, with or without the <code>array1=..</code> statement</p>

<p>Please help,
Thanks</p>