title: How to use self-docummenting equals (debugging) specifier with str.format()?
body: <p>Python 3.8 introduced <code>=</code> specifier in f-strings (see this <a href="https://bugs.python.org/issue36817" rel="nofollow noreferrer">issue</a> and <a href="https://github.com/python/cpython/pull/13123" rel="nofollow noreferrer">pull request</a>).</p>
  <p>It allows to quickly represent both the value and the name of the variable:</p>
  <pre><code>from math import pi as π
  f'{π=}'
  # 'π=3.141592653589793'
  </code></pre>
  <p>I would like to use this feature on a pre-defined string with <code>str.format()</code>:</p>
  <pre><code>'{π=}'.format(π=π)
  </code></pre>
  <p>However, it raises an exception:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  KeyError: 'π='
  </code></pre>
  <p>Is there a way to make it work (e.g. with a special dunder method)?</p>
  <p>Why it may be useful?</p>
  <ul>
  <li>one could have a programmatic template for multiple values of the same variable (in a loop)
  <ul>
  <li>in contrasts, f-strings have to be hardcoded; think about internationalization</li>
  </ul>
  </li>
  <li>one could reference constants defined in a module in its docstring (<code>module.__doc__.format(**vars(module)</code>);
  <ul>
  <li>workaround: define an f-string variable at the end of the module, overwrite the <code>module.__doc__</code> at runtime.</li>
  </ul>
  </li>
  </ul>