On Mon, Apr 11, 2022 at 11:10 AM Chris Angelico <ros...@gmail.com> wrote:
> > I don’t know about anyone else, but I’m not arguing for module scope. > I’m arguing against implicit global configuration. > > > > Steven is, as are a few who have agreed that namespaces are the One > True Way™ to do things. > I'm agreeing with namespaces as well -- which I think is different than the idea of module scope for impict contexts Then we are using names, and can use all the rules form managing the cope of teh names: To use the example of one proposed unit syntax: distance = 500[miles] "miles" would need to be a valid name accessible to that scope -- the writer of that code can choose exactly what that name is, likely by some sort of import: from my_unit_system import miles as oped what I understand was being proposed via a "global registry", which is that code: distance = 500[miles] would work even if there were no name "miles" in that namespace(s) -- and it would, instead go look for it in the global registry -- which could have been manipulated by the application to mean nautical miles, or statute miles, or whatever. And THAT I think is a bad idea. What I'm not suggesting, because I think it wouldn't be that helpful, and maybe not possible would be to have something like: set_units_registry_to(my_units system) and then have: distance = 500[miles] use my_units_system's definition of miles in that module without having explicitly imported the name. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@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/Q3A2YT4WZTWFXVYKZDLL3MFZDKXQXWF5/ Code of Conduct: http://python.org/psf/codeofconduct/