> On 8 Nov 2019, at 18:57, Dan Sommers <2qdxy4rzwzuui...@potatochowder.com> 
> wrote:
> 
> On 11/8/19 11:28 AM, Anders Hovmöller wrote:
> 
> >> On 8 Nov 2019, at 18:06, Dan Sommers <2qdxy4rzwzuui...@potatochowder.com> 
> >> wrote:
> 
> >> On 11/8/19 10:40 AM, Jonathan Fine wrote:
> 
> >>> I think we can learn from Unix/Linux here. Like python, it has a PATH
> >>> variable for finding executables. It also has a command 'which'.
> 
> >> Python already has a "-v" option:
> >>
> >>       -v Print a message each time a module is initialized, showing
> >>              the place (filename or built-in module) from which it is
> >>              loaded.  When given twice, print a message for each file
> >>              that is checked for when searching for a module.  Also
> >>              provides information on module cleanup at exit.
> 
> > Isn't this too late? I mean, this is only relevant if you understand
> > that conflicting module names is the problem you're having. It seems
> > to me like not allowing or warning or something when you get into this
> > situation would actually solve the problem.
> 
> If I don't understand the problem, then I won't know to use a "which"
> command, either (or even to think that such a thing exists in the first
> place).  All I know is that I get weird errors.
> 
> Then again, why would I look for Python's "-v" option?  ;-)

Agreed. 

> This is an old problem:
> 
>    https://groups.google.com/forum/#!topic/comp.lang.python/Gy3YVSqr8DM
> 
> Disallowing a shadowing import seems to be out of the question; a
> warning might be the right compromise.

One could also go one step further and only allow shadowing if one dues so 
explicitly somehow. But a warning seems like it should be the first step 
anyway. 
_______________________________________________
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/OGXOASENOUMFMEGNO4HPLOSOOKJ6Y6RW/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to