This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Rolf Campbell
Recipients Rolf Campbell, brett.cannon, eric.snow, ncoghlan, r.david.murray
Date 2018-05-18.22:11:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526681513.72.0.682650639539.issue33547@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-05-18 22:11:53Rolf Campbellsetrecipients: + Rolf Campbell, brett.cannon, ncoghlan, r.david.murray, eric.snow
2018-05-18 22:11:53Rolf Campbellsetmessageid: <1526681513.72.0.682650639539.issue33547@psf.upfronthosting.co.za>
2018-05-18 22:11:53Rolf Campbelllinkissue33547 messages
2018-05-18 22:11:53Rolf Campbellcreate