On Wed, May 26, 2021 at 11:15 PM Steven D'Aprano <[email protected]> wrote:
>
> On Wed, May 26, 2021 at 10:37:34PM +1000, Chris Angelico wrote:
>
> > Also, what about this:
> >
> > constant x = 10
> > def f():
> >     x = 20
> >
> > SyntaxError? Runtime error? Shadowing?
>
> The x inside the function is just a local variable. The x outside the
> function and the x inside it are in different namespaces and shouldn't
> clobber each other any more than variables in different namespaces do.

I'd kinda expect that too, but given the uncertainties in the rest of
this thread, I wasn't certain.

I'm fairly lost as to what the proposal even is, though. It seems to
morph every time it gets poked.

ChrisA
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/AQFQXG3INBUBBOY7FGJCQKODRWKZDL6A/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to