Rolf Campbell <thats.unpossi...@gmail.com> added the comment:

OK, OK, I think I finally understand what you mean here.  Let me try to repeat 
it just to make sure I really understand:

When requesting a member of a multi-file module (like "func" in my example), 
python only tries to load that member as a module from disk if there isn't 
something already created as part of __init__.py.

In my case, I'm trying to load "func.func" which I specifically created in 
line#1 of func/__init__.py, so Python sees no need to even try to load the 
func/func.py file.

If I comment-out the first line of func/__init__.py, then Python fails to find 
an item called "func.func" and so it tries to load one from disk which causes 
it to load "func/func.py".

My real problem here was that I shouldn't be creating entries in the "func" 
namespace that clash with on-disk sub-modules that I want loaded.

Thanks for your time and effort in explaining this.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33547>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to