On 11/17/20 12:16 PM, Chris Angelico wrote: > On Wed, Nov 18, 2020 at 4:08 AM Richard Damon <rich...@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 this is from a try block inside an except block that then return to more processing in the outer except block
-- Richard Damon _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/WKGWMDXXNYHT3JDBMVDLM5KYTMY4SRL7/ Code of Conduct: http://python.org/psf/codeofconduct/