On Wed, Nov 18, 2020 at 4:08 AM Richard Damon <Richard@damon-family.org> wrote:
One comment about having the exception handler 'save state' and restore it is that frequently the purpose of the exception handler is TO make changes to outer variable to fix things up based on the exception.
I could see the desire of a way to create an internal scope of sorts and create names limited to that scope, but wouldn't want such a scope being anywhere automatic, and likely what would make more sense is defining a particular name (or names) to have a limited scope. The ONLY variable that would be special is the one named in the "except Exc as e:" clause. Everything else would follow the normal rules. This is the only variable that is currently special, and ti'd be the only one that ever needs to be special (since it has the refloop that makes memory management harder).
ChrisA My main thought on that variable, is I would expect it to have a good name that implies it is an exception, not something like e, unless you are reserving e for exceptions, so would be unlikely to shadow unless
On 11/17/20 12:16 PM, Chris Angelico wrote: this is from a try block inside an except block that then return to more processing in the outer except block -- Richard Damon