osdir.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Python-Dev] Compilation of "except FooExc as var" adds useless store


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.

On January 6, 2019 4:05:27 PM UTC, Chris Angelico <rosuav at gmail.com> wrote:
>On Mon, Jan 7, 2019 at 2:52 AM Serhiy Storchaka <storchaka at gmail.com>
>wrote:
>>
>> 06.01.19 17:35, Chris Angelico ????:
>> > On Mon, Jan 7, 2019 at 2:27 AM Serhiy Storchaka
><storchaka at gmail.com> wrote:
>> >> Because there is a reason for such code.
>> >
>> > What reason though??
>>
>> I added references and excerpts in the previous message.
>
>Which I read, and they do not explain the assignment of None. The only
>reference is that the tracker issue mentions having a test case to
>ensure that it's happening, which is further proof that it's
>intentional, but still fails to explain *why*.
>
>ChrisA
>_______________________________________________
>Python-Dev mailing list
>Python-Dev at python.org
>https://mail.python.org/mailman/listinfo/python-dev
>Unsubscribe:
>https://mail.python.org/mailman/options/python-dev/paul%40ganssle.io
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20190106/fd150079/attachment.html>