title: Problems with setdefault and Integers
body: <p>I'm testing the following function:</p>
  
  <pre><code>def getDataMapOfFirstLine(line):
      datamap = {}
      for item in line:
          hierarchy = item.split('^')
          partialmap = datamap
          i=0
          for node in hierarchy:
              partialmap = partialmap.setdefault(node, i)
              i += 1
  
      return datamap
  </code></pre>
  
  <p>It should create a dictionary out of the first line of a csv-file, that looks like this:</p>
  
  <pre><code>nummer;such;ans;bverb^konum;bverb^namebspr;bverb^bank^iident;
  1213;HANS;Hans Dominik;111000222;Hans' account; DE2145432523534232;
  1444555;DIRK;Dirk Daniel;13300002;Dirk's account; DE2134634565462352;
  </code></pre>
  
  <p>As you see these circumflex-signs in each semicolon-separated string are something like a join in SQL. If I execute it, I get this error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "./importtool.py", line 173, in &lt;module&gt;
      main()
    File "./importtool.py", line 38, in main
      analyseImportFile(importfile, parser, options)
    File "./importtool.py", line 119, in analyseImportFile
      datamap = getDataMapOfFirstLine(line)
    File "./importtool.py", line 149, in getDataMapOfFirstLine
      partialmap = partialmap.setdefault(node, i)
  AttributeError: 'int' object has no attribute 'setdefault'
  </code></pre>
  
  <p>If I replace the i in the setdefault-function by {} I get no error:</p>
  
  <pre><code>{'bverb': {'namebspr': {}, 'konum': {}, 'bank': {'iident': {}}}, 'such': {}, 'ans': {}}
  </code></pre>
  
  <p>This is nearly, what I want, but instead of the {} I would like to get a column-number.</p>
  
  <p>I just don't get what is wrong. I tried this in interactive mode:</p>
  
  <pre><code>&gt;&gt;&gt; mydict = {'foo': "Hallo", 'bar': 5}
  &gt;&gt;&gt; mydict.setdefault("sth", 12)
  12
  &gt;&gt;&gt; print mydict
  {'sth': 12, 'foo': 'Hallo', 'bar': 5}
  </code></pre>
  
  <p>As you see, this works...</p>
  
  <p>I appreciate every help. Thanks in advance!</p>