Oleksandr Suvorov <[email protected]> added the comment:

What I mean is why would it need to shadow function variable name if after
except block it's always unbound, what is the reason and why this is
expected?

On Fri, May 22, 2020 at 1:19 PM Oleksandr Suvorov <[email protected]>
wrote:

>
> Oleksandr Suvorov <[email protected]> added the comment:
>
> but if exc variable is only available in except block why then it shadows
> the function variable name?
>
> On Fri, May 22, 2020 at 1:15 PM Christian Heimes <[email protected]>
> wrote:
>
> >
> > Christian Heimes <[email protected]> added the comment:
> >
> > UnboundLocalError is a subclass of NameError. You are getting a more
> > specific error here.
> >
> > >>> UnboundLocalError.__mro__
> > (<class 'UnboundLocalError'>, <class 'NameError'>, <class 'Exception'>,
> > <class 'BaseException'>, <class 'object'>)
> >
> > ----------
> > nosy: +christian.heimes
> >
> > _______________________________________
> > Python tracker <[email protected]>
> > <https://bugs.python.org/issue40728>
> > _______________________________________
> >
>
> ----------
>
> _______________________________________
> Python tracker <[email protected]>
> <https://bugs.python.org/issue40728>
> _______________________________________
>

----------

_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue40728>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to