title: Usage of ConfigParser.setdefault()
body: <p>I am trying to set default values on an instance of <code>configparser.ConfigParser</code> after its instantiation.
  While inspecting the instance I found the method <code>ConfigParser.setdefault()</code>:</p>
  
  <pre><code>Help on method setdefault in module collections.abc:
  
  setdefault(key, default=None) method of configparser.ConfigParser instance
      D.setdefault(k[,d]) -&gt; D.get(k,d), also set D[k]=d if k not in D
  </code></pre>
  
  <p>While this is not very helpful at all, the <a href="https://docs.python.org/3/library/configparser.html" rel="nofollow noreferrer">official documentation</a> does not even mention this <em>public</em> method.</p>
  
  <p>So I started just to try-and-error:</p>
  
  <pre><code>&gt;&gt;&gt; cp.setdefault('asd', 'foo')
  &lt;Section: asd&gt;
  &gt;&gt;&gt; cp['asd']
  &lt;Section: asd&gt;
  &gt;&gt;&gt; cp['asd']['foo']
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/lib/python3.6/configparser.py", line 1233, in __getitem__
      raise KeyError(key)
  KeyError: 'foo'
  &gt;&gt;&gt; cp['foo']
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/lib/python3.6/configparser.py", line 959, in __getitem__
      raise KeyError(key)
  KeyError: 'foo'
  &gt;&gt;&gt; cp.setdefault('asd', {'foo': 'bar'})
  &lt;Section: asd&gt;
  &gt;&gt;&gt; cp['asd']
  &lt;Section: asd&gt;
  &gt;&gt;&gt; cp['asd']['foo']
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/lib/python3.6/configparser.py", line 1233, in __getitem__
      raise KeyError(key)
  KeyError: 'foo'
  &gt;&gt;&gt; cp['foo']
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/lib/python3.6/configparser.py", line 959, in __getitem__
      raise KeyError(key)
  KeyError: 'foo'
  &gt;&gt;&gt; 
  </code></pre>
  
  <p>But I could not figure out how to initialize a default section <code>'asd'</code> with a default key <code>'foo'</code> with value <code>'bar'</code>.</p>
  
  <p>So my questions are:</p>
  
  <ol>
  <li><s>What is the method <code>ConfigParser.setdefault()</code> for?</s></li>
  <li>How can I set defaults on my <code>ConfigParser</code>'s instance after its initialization?</li>
  </ol>
  
  <p><strong>Update</strong><br>
  After some further investigation it turned out that <code>ConfigParser.setdefault()</code> is inherited from <code>_collections_abc.MutableMapping</code>.</p>