title: string.template with arrays as placeholders
body: <p>I have a string that I'm trying to format that looks like this:</p>
  
  <pre><code>output = """&lt;div class="form-group" id="$info["id"]_container"&gt;"""
  </code></pre>
  
  <p>The formatting call looks like this:</p>
  
  <pre><code>Template(output).substitute(locals())
  </code></pre>
  
  <p>My problem is that the substitution is working, but it's substituting all of the values of the info array instead of the id value that I want.</p>
  
  <p>Here's the output:</p>
  
  <pre><code>&lt;div class="form-group" id="{'name': 'my_name', 'type': 'my_type', 'label': 'my_label', 'help_text': 'my_help_text', 'id': 'my_id', 'placeholder': 'my_placeholder', 'class': 'my_class'}["id"]_container"&gt;
  </code></pre>
  
  <p>Here's the output that I want:</p>
  
  <pre><code>&lt;div class="form-group" id="my_id_container"&gt;
  </code></pre>
  
  <p>I've tried using <code>{$info["id"]}</code>, and it just treats it as part of the string and there's no substitution.  I've also tried <code>${$info["id"]}</code>, and it gives:</p>
  
  <pre><code>ValueError: Invalid placeholder in string: line 1, col 51
  </code></pre>
  
  <p>I would really like to accomplish this without using the <code>%s</code> syntax. Is this possible?</p>
  
  <p>For reference, here's all of the code:</p>
  
  <pre><code>   info = {
          "type" : "my_type",
          "name" : "my_name",
          "id" : "my_id",
          "class" : "my_class",
          "label" : "my_label",
          "placeholder" : "my_placeholder",
          "help_text" : "my_help_text"
      }
  
          output = """&lt;div class="form-group" id="$info["id"]_container"&gt;"""
          output_sub = Template(output).substitute(locals()) 
  </code></pre>