Agreed, class namespaces are weird. :-)

On Sun, Oct 31, 2021 at 23:38 Chris Angelico <rosuav@gmail.com> wrote:
On Mon, Nov 1, 2021 at 5:15 PM Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
>
> On 1/11/21 4:59 am, David Mertz, Ph.D. wrote:
> >      b = b
>
> I don't want to live in a universe where this could be anything
> other than a no-op in Python.
>

Be careful what you say: there are some technicalities. If you mean
that it won't change the behaviour of the object referred to by b,
then I absolutely agree, but there are ways that this can be more than
a no-op. Notably, it has very good meaning as a keyword argument (it
means "pass b along, named b"), and as a function parameter (meaning
"accept b, defaulting to b from the outer scope"); and even as a
stand-alone statement, it isn't technically meaningless (it'll force b
to be a local).

But yes, I agree that I don't want this to force the evaluation of
something, which continues to be called b. Even though that's
technically possible already if you have a weird namespace, I wouldn't
call that a good way to write code.

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/HQI3ULA6ZAYEHU7JMKZYLLTAG2IFWIVI/
Code of Conduct: http://python.org/psf/codeofconduct/
--
--Guido (mobile)