<html><head></head><body>I am not familiar enough with the compiler logic, but would it be possible to optimize this away by detecting whether the bound name has already been deleted during the body of the except statement?<br><br><br><div class="gmail_quote">On January 6, 2019 4:18:00 PM UTC, Chris Angelico <rosuav@gmail.com> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On Mon, Jan 7, 2019 at 3:13 AM Paul G <paul@ganssle.io> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"><br> I think Serhiy is saying that if you delete exc before the except body ends, when the compiled code goes to delete it it will fail. Binding to None guarantees that there is something to delete.<br></blockquote><br>Ahh! Thank you. I interpreted that example as a "this is what it<br>compiles to", rather than actual source code that might fail. Can we<br>get this example, suitably annotated, into the documentation<br>somewhere?<br><br>ChrisA<hr>Python-Dev mailing list<br>Python-Dev@python.org<br><a href="https://mail.python.org/mailman/listinfo/python-dev">https://mail.python.org/mailman/listinfo/python-dev</a><br>Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/paul%40ganssle.io">https://mail.python.org/mailman/options/python-dev/paul%40ganssle.io</a><br></pre></blockquote></div></body></html>