On Thu, 2 Jul 2020 at 09:28, Matthias Bussonnier <bussonniermatth...@gmail.com> wrote: > > It's still weird user experience as if you swap case .z and case z you don't > get the Unbound error anymore. SO it can work w/o global.
For some value of work: if z comes before .z, the .z branch will never get evaluated, because the binding of z will take precedence, making the .z branch dead code. This is something I would expect linters to pick up on (eventually), or possibly the compiler itself. And if you don't put z first, anything that hits the .z branch will throw the UnboundLocalError. -Rob _______________________________________________ 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/S5TLBC4G42S5VGPVOT7DIILMSON6MIO7/ Code of Conduct: http://python.org/psf/codeofconduct/