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.19:30:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526671832.2.0.682650639539.issue33547@psf.upfronthosting.co.za>
In-reply-to
Content
Re-opening because I've found a simple example that does not involve __main__.

./func/__init__.py:func = 1
./func/__init__.py:from . import func
./func/__init__.py:print(f"Namespace value of func after func module import:{func}")
./func/func.py:print("Module imported")
./main.py:import func
./main.py:def func(x):
./main.py:	return x

If you create files that look like that, and then run: "python3.6 main.py" I get this output:
Namespace value of func after func module import:1

If I comment out the "func = 1" line, then func ends up being imported (and printing as a <module...>).
History
Date User Action Args
2018-05-18 19:30:32Rolf Campbellsetrecipients: + Rolf Campbell, brett.cannon, ncoghlan, r.david.murray, eric.snow
2018-05-18 19:30:32Rolf Campbellsetmessageid: <1526671832.2.0.682650639539.issue33547@psf.upfronthosting.co.za>
2018-05-18 19:30:32Rolf Campbelllinkissue33547 messages
2018-05-18 19:30:32Rolf Campbellcreate