title: Python: Add statements around for-loop body
body: <p>I have a lot of for-loops like this:</p>
  <pre class="lang-py prettyprint-override"><code>for (i, elem) in enumerate(iter):
      x = do_something1(i, elem)
      do_something2(i, elem)
  </code></pre>
  <p>I'd like to wrap each iteration in a bunch of print statements to make it more clear what's happening, e.g.:</p>
  <pre class="lang-py prettyprint-override"><code>for (i, elem) in enumerate(iter):
      print(f&quot;Iteration #{i}&quot;)
      print( &quot;-----------&quot;)
      x = do_something1(i, elem)
      do_something2(i, elem)
      print(&quot;&quot;)
  </code></pre>
  <p>Note that I don't plan to insert print statements between existing lines of the loop body, only to wrap it around, also I don't plan to use any variables other than <code>i</code> in prints.<br />
  Question: is there an easy way to do this (maybe <code>@decorator</code>-like statement) so as not to copy-paste?</p>