title: How can I suppress newlines within an output array when dumping indented JSON?
body: <p>I have this code:</p>
  <pre><code>import json
  
  my_list = [1, 2, 3]
  my_dict = {&quot;key&quot;: &quot;value&quot;, &quot;boolean&quot;: True}
  my_json = {&quot;object&quot;: my_dict, &quot;array&quot;: my_list}
  
  print(json.dumps(my_json, indent=4))
  </code></pre>
  <p>I get an output like:</p>
  <pre><code>{
      &quot;object&quot;: {
          &quot;key&quot;: &quot;value&quot;,
          &quot;boolean&quot;: true
      },
      &quot;array&quot;: [
          1,
          2,
          3
      ]
  }
  </code></pre>
  <p>I want it the elements of the <code>&quot;array&quot;</code> array to appear on the same line, like so:</p>
  <pre><code>{
      &quot;object&quot;: {
          &quot;key&quot;: &quot;value&quot;,
          &quot;boolean&quot;: true
      },
      &quot;array&quot;: [1, 2, 3]
  }
  </code></pre>
  <p>How can I get this result?</p>