On Mon, Jan 25, 2021 at 10:23 PM Random832 <random...@fastmail.com> wrote:

> On Mon, Jan 25, 2021, at 18:44, Chris Jerdonek wrote:
> > But to issue a warning when a standard module is being overridden like
> > I was suggesting, wouldn’t you also need to know whether the name of
> > the module being imported is a standard name, which is what
> > says.module_names provides?
>
> I don't think the warning would be only useful for stdlib modules... has
> any thought been given to warning when a module being imported from the
> current directory / script directory is the same as an installed package?
>

Related to this, I wonder if another application of sys.stdlib_module_names
could be for installers: When installing a new package, a warning could be
issued if the package is attempting to install a package with a name
already in sys.stdlib_module_names. I don't know off-hand what happens if
one were to try to do that today..

--Chris



>
_______________________________________________
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/XTLEMKOZ4REXKJY2OI5RNJFBAAJABGD7/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to