title: python: union keys from multiple dictionary?
body: <p>I have 5 dictionaries and I want a union of their keys.</p>
  
  <pre><code>alldict =  [dict1, dict2, dict3, dict4, dict5]
  </code></pre>
  
  <p>I tried</p>
  
  <pre><code>allkey = reduce(lambda x, y: set(x.keys()).union(y.keys()), alldict)
  </code></pre>
  
  <p>but it gave me an error</p>
  
  <pre><code>AttributeError: 'set' object has no attribute 'keys'
  </code></pre>
  
  <p>Am I doing it wrong ?  I using normal forloop but I wonder why the above code didn't work.</p>