title: python: json number of attributes (nested)
body: <p>I would like to write a recursive function, that returns the number of different attributes of a json file with unknown nesting depth.</p>
  <p>for simplified example, the function should apply to:</p>
  <pre><code>{data : [
      {age : ...,
       name : ...,
       haircolor : ...
      },
      {age : ...,
       name : ...,
       haircolor : ...
      }
  
  </code></pre>
  <p>but also to:</p>
  <pre><code>{data : [
      {age : ...,
       name : [
             {first : ...,
              last: ...
             }
              ]
       haircolor : ...
      },
      {age : ...,
       name : ...,
       haircolor : ...
      } 
    ] 
  }
  </code></pre>
  <p>I thought about trying to get the length of the dictionaries, but I get the error message:</p>
  <p><em>object of type 'generator' has no len()</em></p>
  <p>does someone know how to solve that?</p>